[−][src]Struct ijson::string::IString
The IString
type is an interned, immutable string, and is where this crate
gets its name.
Cloning an IString
is cheap, and it can be easily converted from &str
or
String
types. Comparisons between IString
s is a simple pointer
comparison.
The memory backing an IString
is reference counted, so that unlike many
string interning libraries, memory is not leaked as new strings are interned.
Interning uses DashSet
, an implementation of a concurrent hash-set, allowing
many strings to be interned concurrently without becoming a bottleneck.
Given the nature of IString
it is better to intern a string once and reuse
it, rather than continually convert from &str
to IString
.
Implementations
impl IString
[src]
pub fn intern(s: &str) -> Self
[src]
Converts a &str
to an IString
by interning it in the global string cache.
pub fn len(&self) -> usize
[src]
Returns the length (in bytes) of this string.
pub fn is_empty(&self) -> bool
[src]
Returns true
if this is the empty string "".
pub fn as_str(&self) -> &str
[src]
Obtains a &str
from this IString
. This is a cheap operation.
pub fn as_bytes(&self) -> &[u8]
[src]
Obtains a byte slice from this IString
. This is a cheap operation.
pub fn new() -> Self
[src]
Returns the empty string.
Trait Implementations
impl AsMut<IValue> for IString
[src]
impl AsRef<IValue> for IString
[src]
impl Borrow<IValue> for IString
[src]
impl Borrow<str> for IString
[src]
impl BorrowMut<IValue> for IString
[src]
pub fn borrow_mut(&mut self) -> &mut IValue
[src]
impl Clone for IString
[src]
impl Debug for IString
[src]
impl Default for IString
[src]
impl Deref for IString
[src]
impl<'de> Deserialize<'de> for IString
[src]
pub fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<'de> Deserializer<'de> for &'de IString
[src]
type Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
pub fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
[src]
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
pub fn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
[src]
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
pub fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_byte_buf<V>(
self,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
pub fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
pub fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
pub fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
pub fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
pub fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
pub fn deserialize_identifier<V>(
self,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
pub fn deserialize_ignored_any<V>(
self,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
pub fn is_human_readable(&self) -> bool
[src]
impl Eq for IString
[src]
impl<'_> From<&'_ String> for IString
[src]
impl<'_> From<&'_ mut String> for IString
[src]
impl<'_> From<&'_ mut str> for IString
[src]
impl<'_> From<&'_ str> for IString
[src]
impl From<IString> for IValue
[src]
impl From<IString> for String
[src]
impl From<String> for IString
[src]
impl Hash for IString
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'de> IntoDeserializer<'de, Error> for &'de IString
[src]
type Deserializer = Self
The type of the deserializer being converted into.
pub fn into_deserializer(self) -> Self::Deserializer
[src]
impl<'_> ObjectIndex for &'_ IString
[src]
pub fn index_into(self, v: &IObject) -> Option<(&IString, &IValue)>
[src]
pub fn index_into_mut(self, v: &mut IObject) -> Option<(&IString, &mut IValue)>
[src]
pub fn index_or_insert(self, v: &mut IObject) -> &mut IValue
[src]
pub fn remove(self, v: &mut IObject) -> Option<(IString, IValue)>
[src]
impl Ord for IString
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<IString> for IString
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<IString> for str
[src]
pub fn eq(&self, other: &IString) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<IString> for String
[src]
pub fn eq(&self, other: &IString) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<String> for IString
[src]
pub fn eq(&self, other: &String) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<str> for IString
[src]
pub fn eq(&self, other: &str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<IString> for IString
[src]
pub fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for IString
[src]
impl<'a> TryFrom<&'a IValue> for &'a IString
[src]
type Error = ()
The type returned in the event of a conversion error.
pub fn try_from(other: &'a IValue) -> Result<Self, ()>
[src]
impl<'a> TryFrom<&'a mut IValue> for &'a mut IString
[src]
type Error = ()
The type returned in the event of a conversion error.
pub fn try_from(other: &'a mut IValue) -> Result<Self, ()>
[src]
impl TryFrom<IValue> for IString
[src]
type Error = IValue
The type returned in the event of a conversion error.
pub fn try_from(other: IValue) -> Result<Self, IValue>
[src]
impl<'_> ValueIndex for &'_ IString
[src]
Auto Trait Implementations
impl RefUnwindSafe for IString
impl Send for IString
impl Sync for IString
impl Unpin for IString
impl UnwindSafe for IString
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,