Skip to main content

Loadable

Trait Loadable 

Source
pub trait Loadable<'a>: Sized {
    // Required method
    fn load(context: Context<'a>) -> Result<Self>;
}
Expand description

Implemented by any value that can be deserialized from a Context.

This is the bottom of the trait hierarchy and is implemented for the same set of primitive-like types as super::save::Saveable. Most user types should implement Load (which gets a Loadable impl for free via the blanket below) rather than Loadable directly.

Required Methods§

Source

fn load(context: Context<'a>) -> Result<Self>

Deserialize Self from a Context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Loadable<'_> for NonZeroU32

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for NonZeroU64

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for NonZeroUsize

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for String

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for bool

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for f32

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for f64

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for i8

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for i16

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for i32

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for i64

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for isize

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for u8

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for u16

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for u32

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for u64

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl Loadable<'_> for usize

Source§

fn load(context: Context<'_>) -> Result<Self>

Source§

impl<'a, T> Loadable<'a> for Option<T>
where T: Loadable<'a>,

Source§

fn load(context: Context<'a>) -> Result<Self>

Source§

impl<'a, T> Loadable<'a> for Vec<T>
where T: Loadable<'a>,

Source§

fn load(context: Context<'a>) -> Result<Self>

Source§

impl<'a> Loadable<'a> for &'a str

Source§

fn load(context: Context<'a>) -> Result<Self>

Implementors§

Source§

impl Loadable<'_> for Handle

Source§

impl<'a, T> Loadable<'a> for T
where T: Load<'a>,