/rust/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.44/src/impls/alloc/string.rs
Line | Count | Source (jump to first uncovered line) |
1 | | use crate::{ |
2 | | string::{ArchivedString, StringResolver}, |
3 | | Archive, Deserialize, DeserializeUnsized, Fallible, Serialize, SerializeUnsized, |
4 | | }; |
5 | | #[cfg(not(feature = "std"))] |
6 | | use ::alloc::string::{String, ToString}; |
7 | | use ::core::cmp::Ordering; |
8 | | |
9 | | impl Archive for String { |
10 | | type Archived = ArchivedString; |
11 | | type Resolver = StringResolver; |
12 | | |
13 | | #[inline] |
14 | 191k | unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { |
15 | 191k | ArchivedString::resolve_from_str(self.as_str(), pos, resolver, out); |
16 | 191k | } <alloc::string::String as rkyv::Archive>::resolve Line | Count | Source | 14 | 191k | unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { | 15 | 191k | ArchivedString::resolve_from_str(self.as_str(), pos, resolver, out); | 16 | 191k | } |
Unexecuted instantiation: <alloc::string::String as rkyv::Archive>::resolve Unexecuted instantiation: <alloc::string::String as rkyv::Archive>::resolve Unexecuted instantiation: <alloc::string::String as rkyv::Archive>::resolve |
17 | | } |
18 | | |
19 | | impl<S: Fallible + ?Sized> Serialize<S> for String |
20 | | where |
21 | | str: SerializeUnsized<S>, |
22 | | { |
23 | | #[inline] |
24 | 191k | fn serialize(&self, serializer: &mut S) -> Result<Self::Resolver, S::Error> { |
25 | 191k | ArchivedString::serialize_from_str(self.as_str(), serializer) |
26 | 191k | } <alloc::string::String as rkyv::Serialize<rkyv::ser::serializers::CompositeSerializer<rkyv::ser::serializers::alloc::AlignedSerializer<rkyv::util::aligned_vec::AlignedVec>, rkyv::ser::serializers::core::FallbackScratch<rkyv::ser::serializers::alloc::HeapScratch<4096>, rkyv::ser::serializers::alloc::AllocScratch>, rkyv::ser::serializers::alloc::SharedSerializeMap>>>::serialize Line | Count | Source | 24 | 191k | fn serialize(&self, serializer: &mut S) -> Result<Self::Resolver, S::Error> { | 25 | 191k | ArchivedString::serialize_from_str(self.as_str(), serializer) | 26 | 191k | } |
Unexecuted instantiation: <alloc::string::String as rkyv::Serialize<_>>::serialize Unexecuted instantiation: <alloc::string::String as rkyv::Serialize<rkyv::ser::serializers::CompositeSerializer<rkyv::ser::serializers::alloc::AlignedSerializer<rkyv::util::aligned_vec::AlignedVec>, rkyv::ser::serializers::core::FallbackScratch<rkyv::ser::serializers::alloc::HeapScratch<4096>, rkyv::ser::serializers::alloc::AllocScratch>, rkyv::ser::serializers::alloc::SharedSerializeMap>>>::serialize Unexecuted instantiation: <alloc::string::String as rkyv::Serialize<_>>::serialize |
27 | | } |
28 | | |
29 | | impl<D: Fallible + ?Sized> Deserialize<String, D> for ArchivedString |
30 | | where |
31 | | str: DeserializeUnsized<str, D>, |
32 | | { |
33 | | #[inline] |
34 | 0 | fn deserialize(&self, _: &mut D) -> Result<String, D::Error> { |
35 | 0 | Ok(self.as_str().to_string()) |
36 | 0 | } Unexecuted instantiation: <rkyv::string::ArchivedString as rkyv::Deserialize<alloc::string::String, rkyv::de::deserializers::alloc::SharedDeserializeMap>>::deserialize Unexecuted instantiation: <rkyv::string::ArchivedString as rkyv::Deserialize<alloc::string::String, rkyv::de::deserializers::alloc::SharedDeserializeMap>>::deserialize Unexecuted instantiation: <rkyv::string::ArchivedString as rkyv::Deserialize<alloc::string::String, _>>::deserialize Unexecuted instantiation: <rkyv::string::ArchivedString as rkyv::Deserialize<alloc::string::String, rkyv::de::deserializers::alloc::SharedDeserializeMap>>::deserialize Unexecuted instantiation: <rkyv::string::ArchivedString as rkyv::Deserialize<alloc::string::String, rkyv::de::deserializers::alloc::SharedDeserializeMap>>::deserialize Unexecuted instantiation: <rkyv::string::ArchivedString as rkyv::Deserialize<alloc::string::String, _>>::deserialize |
37 | | } |
38 | | |
39 | | impl PartialEq<String> for ArchivedString { |
40 | | #[inline] |
41 | 0 | fn eq(&self, other: &String) -> bool { |
42 | 0 | PartialEq::eq(self.as_str(), other.as_str()) |
43 | 0 | } Unexecuted instantiation: <rkyv::string::ArchivedString as core::cmp::PartialEq<alloc::string::String>>::eq Unexecuted instantiation: <rkyv::string::ArchivedString as core::cmp::PartialEq<alloc::string::String>>::eq |
44 | | } |
45 | | |
46 | | impl PartialEq<ArchivedString> for String { |
47 | | #[inline] |
48 | 0 | fn eq(&self, other: &ArchivedString) -> bool { |
49 | 0 | PartialEq::eq(other.as_str(), self.as_str()) |
50 | 0 | } Unexecuted instantiation: <alloc::string::String as core::cmp::PartialEq<rkyv::string::ArchivedString>>::eq Unexecuted instantiation: <alloc::string::String as core::cmp::PartialEq<rkyv::string::ArchivedString>>::eq |
51 | | } |
52 | | |
53 | | impl PartialOrd<ArchivedString> for String { |
54 | | #[inline] |
55 | 0 | fn partial_cmp(&self, other: &ArchivedString) -> Option<Ordering> { |
56 | 0 | self.as_str().partial_cmp(other.as_str()) |
57 | 0 | } Unexecuted instantiation: <alloc::string::String as core::cmp::PartialOrd<rkyv::string::ArchivedString>>::partial_cmp Unexecuted instantiation: <alloc::string::String as core::cmp::PartialOrd<rkyv::string::ArchivedString>>::partial_cmp |
58 | | } |
59 | | |
60 | | impl PartialOrd<String> for ArchivedString { |
61 | | #[inline] |
62 | 0 | fn partial_cmp(&self, other: &String) -> Option<Ordering> { |
63 | 0 | self.as_str().partial_cmp(other.as_str()) |
64 | 0 | } Unexecuted instantiation: <rkyv::string::ArchivedString as core::cmp::PartialOrd<alloc::string::String>>::partial_cmp Unexecuted instantiation: <rkyv::string::ArchivedString as core::cmp::PartialOrd<alloc::string::String>>::partial_cmp |
65 | | } |