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

pub struct Short { /* fields omitted */ }

Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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.

Formats the value using the given formatter. Read more

Performs the conversion.

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.