[][src]Struct json::short::Short

pub struct Short { /* fields omitted */ }

Methods

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]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<Short> for String[src]

impl PartialEq<Short> for Short[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<str> for Short[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<Short> for str[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<String> for Short[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<Short> for String[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Copy for Short[src]

impl Display 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.

type Target = str

The resulting type after dereferencing.

Auto Trait Implementations

impl Sync for Short

impl Send for Short

impl Unpin for Short

impl RefUnwindSafe for Short

impl UnwindSafe for Short

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]