[][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.

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.

Cheaply obtain a &str slice out of the Short.

Trait Implementations

impl Clone for Short
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Short
[src]

impl From<Short> for String
[src]

Performs the conversion.

impl PartialEq<Short> for Short
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialEq<str> for Short
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialEq<Short> for str
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialEq<String> for Short
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialEq<Short> for String
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Display for Short
[src]

Formats the value using the given formatter. Read more

impl Debug for Short
[src]

Formats the value using the given formatter. Read more

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.

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

impl Send for Short

impl Sync for Short

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

Converts the given value to a String. Read more

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

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more