[][src]Trait sml::FromSmall

pub trait FromSmall {
    fn from_small(slice: &SmallRef) -> Result<Self, SmallError>
    where
        Self: Sized
; fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError>
    where
        Self: Sized
, { ... }
fn from_str(s: &str) -> Result<Self, SmallError>
    where
        Self: Sized
, { ... }
fn from_str_debug(s: &str) -> Self
    where
        Self: Sized
, { ... } }

Types that implement the FromSmall trait can be constructed from a Small-formatted string.

Required methods

fn from_small(slice: &SmallRef) -> Result<Self, SmallError> where
    Self: Sized

The from_small() function describes how to create a data-structure from the parts of SmallRef. See example 1 for canonical usage.

Loading content...

Provided methods

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized

Reduces SmallRef to the key_path and then uses the FromSmall trait to convert to the receiver type.

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized

Top level function that converts a Small-formatted string into the receiver.

fn from_str_debug(s: &str) -> Self where
    Self: Sized

Top level function that converts a Small-formatted string into the receiver giving helpful error messages for debugging.

Loading content...

Implementations on Foreign Types

impl FromSmall for String[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for u8[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for i8[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for u16[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for i16[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for u32[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for i32[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for u64[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for i64[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for u128[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for i128[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for usize[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for isize[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for f32[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for f64[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl FromSmall for bool[src]

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl<T> FromSmall for Option<T> where
    T: FromSmall
[src]

Converts a Vec with either one or no Small elements to an Option<T>. See Example 1 for details.

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

impl<T> FromSmall for Vec<T> where
    T: FromSmall
[src]

Converts a Vec of Small elements to a Vec<T>. See Example 1 for details.

fn path(small: &SmallRef, key_path: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str(s: &str) -> Result<Self, SmallError> where
    Self: Sized
[src]

fn from_str_debug(s: &str) -> Self where
    Self: Sized
[src]

Loading content...

Implementors

Loading content...