[−][src]Struct sml::Small
Small
represents a string in Small
data format.
Methods
impl Small
[src]
pub fn from_str(s: &str) -> Result<Self, SmallError>
[src]
Converts a Small
-formatted string into a Small
type. This is only one step in creating a
type from a Small
-formatted string. Generally, its better to call the from_str()
function on a user-defined type, rather than on Small
. See the basic organization diagram.
pub fn key_value(key: &str, value: String) -> Result<Small, SmallError>
[src]
Returns a Small
type that consists of one key-value pair. For example
Small::key_value("age", self.age).unwrap()
pub fn join(key: &str, subs: &Vec<Small>) -> Result<Small, SmallError>
[src]
Returns a Small
type given a key and a Vec
of Small
s. The Vec
of Small
s are
indented below the key. See example 2.
pub fn to_ref(&self) -> SmallRef
[src]
Converts self
into a SmallRef
.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,