[−][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]
pub fn key_value(key: &str, value: String) -> Result<Small, SmallError>
[src]
pub fn key(key: &str) -> Result<Small, SmallError>
[src]
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. For example,
Small::join("hobbit", &vec!( self.name.to_small("name")?, self.age.to_small("age")?, self.friends.to_small("friends")?, self.bicycle.to_small("bicycle")?, ))
returns a Small
type that can be displayed as,
hobbit:
name: "Frodo Baggins"
age: "98"
friends:
hobbit:
name: "Bilbo Baggins"
age: "176"
hobbit:
name: "Samwise Gamgee"
age: "66""#;
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?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>,