pub fn deser<T: serde::de::DeserializeOwned>(&self) -> Result<T, Error> {
        let mut fields = self.fields().clone();
        fields.insert(
            "__label".to_string(),
            Value::String(self.concrete_typename.clone()),
        );
        let m = Value::Map(fields);
        let v = serde_json::Value::try_from(m)?;
        let t: T = serde_json::from_value(v)
            .map_err(|e| Error::JsonDeserializationFailed { source: e })?;
        Ok(t)
    }
/// Attempts to deserialize a `Node` into a struct.
///
/// # Example
/// ```rust
/// # use serde::Deserialize;
/// # use warpgrapher::engine::objects::Node;
///
/// #[derive(Deserialize)]
/// struct Team {
///     name: String
/// }
///
/// fn handle_node(n: Node<()>) {
///
///     // succeeds if the fields of `n` can be deserialized into `Team`
///     let team: Team = n.deser().unwrap();
///     
/// }
/// ```
Attempts to deserialize a `Node` into a struct.
Attempts to deserialize a ` Node ` into a struct .
pub fn deser<T: serde::de::DeserializeOwned>(&self) -> Result<T, Error> {
        let mut fields = self.fields().clone();
        fields.insert(
            "__label".to_string(),
            Value::String(self.concrete_typename.clone()),
        );
        let m = Value::Map(fields);
        let v = serde_json::Value::try_from(m)?;
        let t: T = serde_json::from_value(v)
            .map_err(|e| Error::JsonDeserializationFailed { source: e })?;
        Ok(t)
    }
pub fn deser < T : serde :: de :: DeserializeOwned > ( & self ) -> Result < T , Error > { let mut fields = self . fields ( ) . clone ( ) ; fields . insert ( " " . to_string ( ) , Value :: String ( self . concrete_typename . clone ( ) ) , ) ; let m = Value :: Map ( fields ) ; let v = serde_json :: Value :: try_from ( m ) ? ; let t : T = serde_json :: from_value ( v ) . map_err ( | e | Error :: JsonDeserializationFailed { source : e } ) ? ; Ok ( t ) }
Attempts to deserialize a `Node` into a struct.
Attempts to deserialize a ` Node ` into a struct .
&self
&self
example
None
use serde::deserialize;
None
use warpgrapher::engine::objects::node;
None
[derive(deserialize)]
struct Team {
name: String
}

fn handle_node(n: Node<()>) {

succeeds if the fields of `n` can be deserialized into `Team`
let team: Team = n.deser().unwrap().


struct Team { name : String } fn handle_node ( n : Node< () > ) { succeeds if the fields of ` n ` can be deserialized into ` Team ` let team : Team = n . deser () . unwrap () .