Struct urbit_http_api::graph::Node [−][src]
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
impl Node
[src]
pub fn new(
index: String,
author: String,
time_sent: u64,
signatures: Vec<Signature>,
contents: NodeContents,
hash: Option<String>
) -> Node
[src]
index: String,
author: String,
time_sent: u64,
signatures: Vec<Signature>,
contents: NodeContents,
hash: Option<String>
) -> Node
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,