[−][src]Struct json::short::Short
Implementations
impl Short[src]
A Short is a small string, up to MAX_LEN bytes, that can be managed without
the expensive heap allocation performed for the regular String type.
pub unsafe fn from_slice(slice: &str) -> Self[src]
Creates a Short from a &str slice. This method can cause buffer
overflow if the length of the slice is larger than MAX_LEN, which is why
it is marked as unsafe.
Typically you should avoid creating your own Shorts, instead create a
JsonValue (either using "foo".into() or JsonValue::from("foo")) out
of a slice. This will automatically decide on String or Short for you.
pub fn as_str(&self) -> &str[src]
Cheaply obtain a &str slice out of the Short.
Trait Implementations
impl Clone for Short[src]
impl Copy for Short[src]
impl Debug for Short[src]
impl Deref for Short[src]
Implements Deref for Short means that, just like String, you can
pass &Short to functions that expect &str and have the conversion happen
automagically. On top of that, all methods present on &str can be called on
an instance of Short.
impl Display for Short[src]
impl From<Short> for String[src]
impl PartialEq<Short> for Short[src]
impl PartialEq<Short> for str[src]
impl PartialEq<Short> for String[src]
impl PartialEq<String> for Short[src]
impl PartialEq<str> for Short[src]
Auto Trait Implementations
impl RefUnwindSafe for Short[src]
impl Send for Short[src]
impl Sync for Short[src]
impl Unpin for Short[src]
impl UnwindSafe for Short[src]
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> 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> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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>,