Struct GraphStore

Source
pub struct GraphStore<'a> {
    pub channel: &'a mut Channel,
}
Expand description

A struct which exposes Graph Store functionality

Fields§

§channel: &'a mut Channel

Implementations§

Source§

impl<'a> GraphStore<'a>

Source

pub fn new_node(&self, contents: &NodeContents) -> Node

Create a new Graph Store node using defaults from the connected ship and local time. This is a wrapper method around Node::new() which fills out a lot of boilerplate.

Source

pub fn new_node_specified( &self, node_index: &str, unix_time: u64, contents: &NodeContents, ) -> Node

Create a new Graph Store node using a specified index and creation time using the connected ship as author

Source

pub fn add_node( &mut self, resource_ship: &str, resource_name: &str, node: &Node, ) -> Result<()>

Add node to Graph Store

Source

pub fn add_node_spider( &mut self, resource_ship: &str, resource_name: &str, node: &Node, ) -> Result<()>

Add node to Graph Store via spider thread

Source

pub fn remove_nodes( &mut self, resource_ship: &str, resource_name: &str, indices: Vec<&str>, ) -> Result<()>

Remove nodes from Graph Store using the provided list of indices

Source

pub fn get_node( &mut self, resource_ship: &str, resource_name: &str, node_index: &str, ) -> Result<Node>

Acquire a node from Graph Store

Source

pub fn get_node_subset( &mut self, resource_ship: &str, resource_name: &str, node_index: &str, start_index: &str, end_index: &str, ) -> Result<Graph>

Acquire a subset of children of a node from Graph Store by specifying the start and end indices of the subset children.

Source

pub fn create_managed_graph( &mut self, graph_resource_name: &str, graph_title: &str, graph_description: &str, graph_module: Module, managed_group_ship: &str, managed_group_name: &str, ) -> Result<()>

Create a new graph on the connected Urbit ship that is managed (meaning associated with a specific group)

Source

pub fn create_unmanaged_graph( &mut self, graph_resource_name: &str, graph_title: &str, graph_description: &str, graph_module: Module, ) -> Result<()>

Create a new graph on the connected Urbit ship that is unmanaged (meaning not associated with any group)

Source

pub fn get_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<Graph>

Acquire a graph from Graph Store

Source

pub fn get_graph_subset( &mut self, resource_ship: &str, resource_name: &str, start_index: &str, end_index: &str, ) -> Result<Graph>

Acquire a subset of a graph from Graph Store by specifying the start and end indices of the subset of the graph.

Source

pub fn delete_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<()>

Delete graph from Graph Store

Source

pub fn leave_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<()>

Leave graph in Graph Store

Source

pub fn archive_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<String>

Archive a graph in Graph Store

Source

pub fn unarchive_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<String>

Unarchive a graph in Graph Store

Source

pub fn add_tag( &mut self, resource_ship: &str, resource_name: &str, tag: &str, ) -> Result<()>

Add a tag to a graph

Source

pub fn remove_tag( &mut self, resource_ship: &str, resource_name: &str, tag: &str, ) -> Result<()>

Remove a tag from a graph

Source

pub fn get_keys(&mut self) -> Result<Vec<JsonValue>>

Performs a scry to get all keys

Source

pub fn get_tags(&mut self) -> Result<Vec<JsonValue>>

Performs a scry to get all tags

Source

pub fn get_tag_queries(&mut self) -> Result<Vec<JsonValue>>

Performs a scry to get all tags

Source

pub fn peek_update_log( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<String>

Acquire the time the update log of a given resource was last updated

Source

pub fn get_update_log( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<String>

Acquire the update log for a given resource

Source

pub fn get_update_log_subset( &mut self, resource_ship: &str, resource_name: &str, start_index: &str, end_index: &str, ) -> Result<String>

Acquire a subset of the update log for a given resource

Auto Trait Implementations§

§

impl<'a> Freeze for GraphStore<'a>

§

impl<'a> !RefUnwindSafe for GraphStore<'a>

§

impl<'a> Send for GraphStore<'a>

§

impl<'a> Sync for GraphStore<'a>

§

impl<'a> Unpin for GraphStore<'a>

§

impl<'a> !UnwindSafe for GraphStore<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,