pub struct WriteTxn<'a> { /* private fields */ }Expand description
A read-write transaction on the graph.
Implementations§
Source§impl WriteTxn<'_>
impl WriteTxn<'_>
pub fn get_node(&self, id: NodeId) -> Result<Option<NodeRecord>, Error>
pub fn get_edge(&self, id: EdgeId) -> Result<Option<EdgeRecord>, Error>
pub fn out_neighbors(&self, node: NodeId) -> Result<Vec<NeighborEntry>, Error>
pub fn in_neighbors(&self, node: NodeId) -> Result<Vec<NeighborEntry>, Error>
pub fn nodes_by_label(&self, label: &str) -> Result<Vec<NodeId>, Error>
pub fn edges_by_type(&self, etype: &str) -> Result<Vec<EdgeId>, Error>
pub fn label_name(&self, id: LabelId) -> Result<Option<String>, Error>
pub fn type_name(&self, id: TypeId) -> Result<Option<String>, Error>
pub fn node_count_by_label(&self, label: &str) -> Result<u64, Error>
pub fn edge_count_by_type(&self, etype: &str) -> Result<u64, Error>
pub fn all_nodes(&self) -> Result<Vec<NodeId>, Error>
pub fn has_node_property_index( &self, label: &str, property: &str, ) -> Result<bool, Error>
pub fn nodes_by_property( &self, label: &str, property: &str, val: PropValue, ) -> Result<Vec<NodeId>, Error>
pub fn nodes_by_property_range( &self, label: &str, property: &str, min_val: Option<PropValue>, min_inclusive: bool, max_val: Option<PropValue>, max_inclusive: bool, ) -> Result<Vec<NodeId>, Error>
pub fn edges_by_property( &self, etype: &str, property: &str, val: PropValue, ) -> Result<Vec<EdgeId>, Error>
pub fn edges_by_property_range( &self, etype: &str, property: &str, min_val: Option<PropValue>, max_val: Option<PropValue>, ) -> Result<Vec<EdgeId>, Error>
pub fn add_node( &mut self, label: &str, props: &impl Serialize, ) -> Result<NodeId, Error>
Sourcepub fn add_node_multi(
&mut self,
labels: &[&str],
props: &impl Serialize,
) -> Result<NodeId, Error>
pub fn add_node_multi( &mut self, labels: &[&str], props: &impl Serialize, ) -> Result<NodeId, Error>
Insert a node with zero or more labels inside this write transaction.
pub fn update_node( &mut self, id: NodeId, props: &impl Serialize, ) -> Result<(), Error>
Sourcepub fn add_label(&mut self, id: NodeId, label: &str) -> Result<(), Error>
pub fn add_label(&mut self, id: NodeId, label: &str) -> Result<(), Error>
Add a label to an existing node inside this write transaction.
Sourcepub fn remove_label(&mut self, id: NodeId, label: &str) -> Result<(), Error>
pub fn remove_label(&mut self, id: NodeId, label: &str) -> Result<(), Error>
Remove a label from an existing node inside this write transaction.
pub fn delete_node(&mut self, id: NodeId) -> Result<(), Error>
pub fn delete_edge(&mut self, id: EdgeId) -> Result<(), Error>
pub fn add_edge( &mut self, src: NodeId, dst: NodeId, etype: &str, props: &impl Serialize, ) -> Result<EdgeId, Error>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for WriteTxn<'a>
impl<'a> !Sync for WriteTxn<'a>
impl<'a> !UnwindSafe for WriteTxn<'a>
impl<'a> Freeze for WriteTxn<'a>
impl<'a> Send for WriteTxn<'a>
impl<'a> Unpin for WriteTxn<'a>
impl<'a> UnsafeUnpin for WriteTxn<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more