[][src]Trait activitystreams_new::unparsed::UnparsedMutExt

pub trait UnparsedMutExt: UnparsedMut {
    fn remove<T>(&mut self, key: &str) -> Result<T, Error>
    where
        T: DeserializeOwned
, { ... }
fn insert<T>(&mut self, key: &str, value: T) -> Result<&mut Self, Error>
    where
        T: Serialize
, { ... } }

A helper trait providing two methods, 'insert' and 'remove', that is auto-implemented for UnparsedMut types.

These methods are provided for easily pulling values from and inserting values into the Unparsed struct.

Provided methods

fn remove<T>(&mut self, key: &str) -> Result<T, Error> where
    T: DeserializeOwned

Remove a value from the Unparsed struct, provided it matches the expected type

fn insert<T>(&mut self, key: &str, value: T) -> Result<&mut Self, Error> where
    T: Serialize

Insert a value into the Unparsed struct if the value isn't Null

Loading content...

Implementors

impl<T> UnparsedMutExt for T where
    T: UnparsedMut
[src]

Loading content...