Struct urbit_http_api::graph::Node[][src]

pub struct Node {
    pub index: String,
    pub author: String,
    pub time_sent: u64,
    pub signatures: Vec<Signature>,
    pub contents: NodeContents,
    pub hash: Option<String>,
    pub children: Vec<Node>,
}

Struct which represents a node in a graph in Graph Store

Fields

index: Stringauthor: Stringtime_sent: u64signatures: Vec<Signature>contents: NodeContentshash: Option<String>children: Vec<Node>

Implementations

impl Node[src]

pub fn new(
    index: String,
    author: String,
    time_sent: u64,
    signatures: Vec<Signature>,
    contents: NodeContents,
    hash: Option<String>
) -> Node
[src]

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

Extract the node’s final section (after the last /) of the index

pub fn parent_index(&self) -> Option<String>[src]

Extract the Node’s parent’s index (if parent exists)

pub fn is_parent(&self, potential_child: &Node) -> bool[src]

Check if a self is the direct parent of another Node.

pub fn is_ancestor(&self, potential_child: &Node) -> bool[src]

Check if self is a parent (direct or indirect) of another Node

pub fn add_child(&self, new_child: &Node) -> Node[src]

Creates a copy of self and searches through the children to find the deepest depth which the new_child can be placed.

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

Formats the time_sent field to be human readable date-time in UTC

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

Converts to JsonValue creates a json object with one field: key = the node’s full index path, value = json representation of node

pub fn from_graph_update_json(wrapped_json: &JsonValue) -> Result<Node>[src]

Convert from node JsonValue which is wrapped up in a few wrapper fields into a Node, with children if they exist.

pub fn from_json(json: &JsonValue) -> Result<Node>[src]

Convert from straight node JsonValue to Node

Trait Implementations

impl Clone for Node[src]

impl Debug for Node[src]

Auto Trait Implementations

impl RefUnwindSafe for Node

impl Send for Node

impl Sync for Node

impl Unpin for Node

impl UnwindSafe for Node

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,