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>
impl<'a> GraphStore<'a>
Sourcepub fn new_node(&self, contents: &NodeContents) -> Node
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.
Sourcepub fn new_node_specified(
&self,
node_index: &str,
unix_time: u64,
contents: &NodeContents,
) -> Node
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
Sourcepub fn add_node(
&mut self,
resource_ship: &str,
resource_name: &str,
node: &Node,
) -> Result<()>
pub fn add_node( &mut self, resource_ship: &str, resource_name: &str, node: &Node, ) -> Result<()>
Add node to Graph Store
Sourcepub fn add_node_spider(
&mut self,
resource_ship: &str,
resource_name: &str,
node: &Node,
) -> Result<()>
pub fn add_node_spider( &mut self, resource_ship: &str, resource_name: &str, node: &Node, ) -> Result<()>
Add node to Graph Store via spider thread
Sourcepub fn remove_nodes(
&mut self,
resource_ship: &str,
resource_name: &str,
indices: Vec<&str>,
) -> Result<()>
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
Sourcepub fn get_node(
&mut self,
resource_ship: &str,
resource_name: &str,
node_index: &str,
) -> Result<Node>
pub fn get_node( &mut self, resource_ship: &str, resource_name: &str, node_index: &str, ) -> Result<Node>
Acquire a node from Graph Store
Sourcepub fn get_node_subset(
&mut self,
resource_ship: &str,
resource_name: &str,
node_index: &str,
start_index: &str,
end_index: &str,
) -> Result<Graph>
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.
Sourcepub 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<()>
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)
Sourcepub fn create_unmanaged_graph(
&mut self,
graph_resource_name: &str,
graph_title: &str,
graph_description: &str,
graph_module: Module,
) -> Result<()>
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)
Sourcepub fn get_graph(
&mut self,
resource_ship: &str,
resource_name: &str,
) -> Result<Graph>
pub fn get_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<Graph>
Acquire a graph from Graph Store
Sourcepub fn get_graph_subset(
&mut self,
resource_ship: &str,
resource_name: &str,
start_index: &str,
end_index: &str,
) -> Result<Graph>
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.
Sourcepub fn delete_graph(
&mut self,
resource_ship: &str,
resource_name: &str,
) -> Result<()>
pub fn delete_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<()>
Delete graph from Graph Store
Sourcepub fn leave_graph(
&mut self,
resource_ship: &str,
resource_name: &str,
) -> Result<()>
pub fn leave_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<()>
Leave graph in Graph Store
Sourcepub fn archive_graph(
&mut self,
resource_ship: &str,
resource_name: &str,
) -> Result<String>
pub fn archive_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<String>
Archive a graph in Graph Store
Sourcepub fn unarchive_graph(
&mut self,
resource_ship: &str,
resource_name: &str,
) -> Result<String>
pub fn unarchive_graph( &mut self, resource_ship: &str, resource_name: &str, ) -> Result<String>
Unarchive a graph in Graph Store
Sourcepub fn add_tag(
&mut self,
resource_ship: &str,
resource_name: &str,
tag: &str,
) -> Result<()>
pub fn add_tag( &mut self, resource_ship: &str, resource_name: &str, tag: &str, ) -> Result<()>
Add a tag to a graph
Sourcepub fn remove_tag(
&mut self,
resource_ship: &str,
resource_name: &str,
tag: &str,
) -> Result<()>
pub fn remove_tag( &mut self, resource_ship: &str, resource_name: &str, tag: &str, ) -> Result<()>
Remove a tag from a graph
Performs a scry to get all tags
Sourcepub fn get_tag_queries(&mut self) -> Result<Vec<JsonValue>>
pub fn get_tag_queries(&mut self) -> Result<Vec<JsonValue>>
Performs a scry to get all tags
Sourcepub fn peek_update_log(
&mut self,
resource_ship: &str,
resource_name: &str,
) -> Result<String>
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