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<String>
contents: NodeContents
hash: Option<String>
children: Vec<Node>
Implementations
impl Node
[src]
pub fn new(
index: String,
author: String,
time_sent: u64,
signatures: Vec<String>,
contents: NodeContents,
hash: Option<String>
) -> Node
[src]
index: String,
author: String,
time_sent: u64,
signatures: Vec<String>,
contents: NodeContents,
hash: Option<String>
) -> Node
pub fn parent_index(&self) -> Option<String>
[src]
Extract the Node
's parent's index (if parent exists)
pub fn is_direct_parent(&self, potential_child: &Node) -> bool
[src]
Check if a self is the direct parent of another Node
.
pub fn is_parent(&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 to_formatted_string(&self) -> String
[src]
Converts the Node
into a human readable formatted string which
includes the author, date, and node contents.
pub fn to_json(&self, children: Option<JsonValue>) -> JsonValue
[src]
Converts to JsonValue
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
.
Defaults to no children.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Node
[src]
impl Send for Node
[src]
impl Sync for Node
[src]
impl Unpin for Node
[src]
impl UnwindSafe for Node
[src]
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>,