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>,
}
Expand description
Struct which represents a node in a graph in Graph Store
Fields
index: String
time_sent: u64
signatures: Vec<Signature>
contents: NodeContents
hash: Option<String>
children: Vec<Node>
Implementations
pub fn new(
index: String,
author: String,
time_sent: u64,
signatures: Vec<Signature>,
contents: NodeContents,
hash: Option<String>
) -> Node
Extract the node’s final section (after the last /
) of the index
Extract the Node
’s parent’s index (if parent exists)
Check if a self is the direct parent of another Node
.
Check if self is a parent (direct or indirect) of another Node
Creates a copy of self and searches through the children to find
the deepest depth which the new_child
can be placed.
Formats the time_sent
field to be human readable date-time in UTC
Converts to JsonValue
creates a json object with one field: key = the node’s full index path, value = json representation of node
Convert from node JsonValue
which is wrapped up in a few wrapper fields
into a Node
, with children if they exist.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Node
impl UnwindSafe for Node
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more