[][src]Struct kg_tree::NodeRef

pub struct NodeRef(_);

Methods

impl NodeRef[src]

pub fn null() -> NodeRef[src]

pub fn boolean(b: bool) -> NodeRef[src]

pub fn integer(n: i64) -> NodeRef[src]

pub fn float(n: f64) -> NodeRef[src]

pub fn string<S: Into<String>>(s: S) -> NodeRef[src]

pub fn binary<B: Into<Vec<u8>>>(b: B) -> NodeRef[src]

pub fn array(elems: Elements) -> NodeRef[src]

pub fn object(props: Properties) -> NodeRef[src]

pub fn is_consumable(&self) -> bool[src]

pub fn into_consumable(self) -> NodeRef[src]

pub fn from_type<T>(value: T) -> Result<NodeRef, Error> where
    T: Serialize
[src]

pub fn from_json(s: &str) -> Result<NodeRef, ParseDiag>[src]

pub fn from_yaml(s: &str) -> Result<NodeRef, ParseDiag>[src]

pub fn from_toml(s: &str) -> Result<NodeRef, ParseDiag>[src]

pub fn from_str(s: Cow<str>, format: FileFormat) -> Result<NodeRef, BasicDiag>[src]

pub fn from_bytes(s: &[u8], format: FileFormat) -> Result<NodeRef, BasicDiag>[src]

pub fn from_file(
    file_path: &Path,
    format: Option<FileFormat>
) -> Result<NodeRef, BasicDiag>
[src]

pub fn to_type<'de, T>(&self) -> Result<T, Error> where
    T: Deserialize<'de>, 
[src]

pub fn to_json(&self) -> String[src]

pub fn to_json_pretty(&self) -> String[src]

pub fn to_yaml(&self) -> String[src]

pub fn to_toml(&self) -> String[src]

pub fn to_format(&self, format: FileFormat, pretty: bool) -> String[src]

pub fn data(&self) -> Ref<Node>[src]

pub fn data_mut(&self) -> RefMut<Node>[src]

pub fn data_ptr(&self) -> *const Node[src]

pub fn path(&self) -> Opath[src]

pub fn into_string(self) -> String[src]

pub fn as_string(&self) -> String[src]

pub fn as_integer(&self) -> Option<i64>[src]

pub fn as_float(&self) -> f64[src]

pub fn as_binary(&self) -> Option<Vec<u8>>[src]

pub fn as_boolean(&self) -> bool[src]

pub fn is_integer(&self) -> bool[src]

pub fn is_float(&self) -> bool[src]

pub fn is_number(&self) -> bool[src]

pub fn is_object(&self) -> bool[src]

pub fn is_string(&self) -> bool[src]

pub fn is_array(&self) -> bool[src]

pub fn is_binary(&self) -> bool[src]

pub fn is_boolean(&self) -> bool[src]

pub fn is_null(&self) -> bool[src]

pub fn is_parent(&self) -> bool[src]

pub fn get_child_index(&self, index: usize) -> Option<NodeRef>[src]

pub fn get_child_key(&self, key: &str) -> Option<NodeRef>[src]

pub fn add_child(
    &self,
    index: Option<usize>,
    key: Option<Symbol>,
    value: NodeRef
) -> Result<Option<NodeRef>, BasicDiag>
[src]

pub fn set_child(
    &self,
    index: Option<usize>,
    key: Option<Symbol>,
    value: NodeRef
) -> Result<Option<NodeRef>, BasicDiag>
[src]

pub fn add_children<'a, I>(
    &self,
    drop: bool,
    items: I
) -> Result<Vec<NodeRef>, BasicDiag> where
    I: Iterator<Item = (Option<usize>, Option<Symbol>, NodeRef)>, 
[src]

pub fn remove_child(
    &self,
    index: Option<usize>,
    key: Option<Cow<str>>
) -> Result<Option<NodeRef>, BasicDiag>
[src]

pub fn remove_children<'a, I>(
    &self,
    drop: bool,
    items: I
) -> Result<Vec<NodeRef>, TreeErrorDetail> where
    I: Iterator<Item = (Option<usize>, Option<Cow<'a, str>>)>, 
[src]

pub fn extend(&self, o: NodeRef, index: Option<usize>) -> Result<(), BasicDiag>[src]

pub fn extend_multiple<I>(&self, extends: I) -> Result<(), BasicDiag> where
    I: Iterator<Item = (NodeRef, Option<usize>)>, 
[src]

pub fn is_ref_eq(&self, other: &NodeRef) -> bool[src]

pub fn deep_copy(&self) -> NodeRef[src]

pub fn visit_recursive<F>(&self, visitor: F) where
    F: FnMut(&NodeRef, &NodeRef, &NodeRef) -> bool
[src]

pub fn visit_children<F>(&self, visitor: F) -> bool where
    F: FnMut(&NodeRef, &NodeRef) -> bool
[src]

pub fn heap_size(&self) -> usize[src]

pub fn is_equal(&self, other: &NodeRef) -> bool[src]

pub fn is_identical(&self, other: &NodeRef) -> bool[src]

pub fn is_identical_deep(&self, other: &NodeRef) -> bool[src]

pub fn with_span(self, span: Span) -> NodeRef[src]

Trait Implementations

impl<'a> Clone for NodeRef[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<NodeRef> for NodeSet[src]

impl<'a> PartialOrd<NodeRef> for NodeRef[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> PartialEq<NodeRef> for NodeRef[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<'a> Display for NodeRef[src]

impl Debug for NodeRef[src]

impl<'a> HeapSizeOf for NodeRef[src]

impl<'a> Serialize for NodeRef[src]

impl<'de> Deserialize<'de> for NodeRef[src]

Auto Trait Implementations

impl !Sync for NodeRef

impl !Send for NodeRef

impl Unpin for NodeRef

impl !RefUnwindSafe for NodeRef

impl !UnwindSafe for NodeRef

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]