[−][src]Struct json::short::Short
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 Short
s, 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 Copy for Short
[src]
impl Clone for Short
[src]
fn clone(&self) -> Short
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Short> for Short
[src]
fn eq(&self, other: &Short) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<str> for Short
[src]
fn eq(&self, other: &str) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<Short> for str
[src]
fn eq(&self, other: &Short) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<String> for Short
[src]
fn eq(&self, other: &String) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<Short> for String
[src]
fn eq(&self, other: &Short) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl From<Short> for String
[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 Debug for Short
[src]
impl Display for Short
[src]
Auto Trait Implementations
impl Sync for Short
impl Unpin for Short
impl Send for Short
impl UnwindSafe for Short
impl RefUnwindSafe for Short
Blanket Implementations
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.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,