pub struct WriteTransaction<'db> { /* private fields */ }Expand description
Implementations§
Source§impl WriteTransaction<'_>
impl WriteTransaction<'_>
Sourcepub fn register_relation_type(
&mut self,
name: impl Into<String>,
) -> Result<RelationTypeId, DbError>
pub fn register_relation_type( &mut self, name: impl Into<String>, ) -> Result<RelationTypeId, DbError>
Sourcepub fn register_property_key(
&mut self,
name: impl Into<String>,
family: PropertyFamily,
value_type: PropertyType,
) -> Result<PropertyKeyId, DbError>
pub fn register_property_key( &mut self, name: impl Into<String>, family: PropertyFamily, value_type: PropertyType, ) -> Result<PropertyKeyId, DbError>
Sourcepub fn define_projection(
&mut self,
definition: ProjectionDefinition,
) -> Result<ProjectionId, DbError>
pub fn define_projection( &mut self, definition: ProjectionDefinition, ) -> Result<ProjectionId, DbError>
Sourcepub fn define_index(
&mut self,
name: impl Into<String>,
definition: IndexDefinition,
) -> Result<IndexId, DbError>
pub fn define_index( &mut self, name: impl Into<String>, definition: IndexDefinition, ) -> Result<IndexId, DbError>
Sourcepub fn create_element(&mut self) -> Result<ElementId, DbError>
pub fn create_element(&mut self) -> Result<ElementId, DbError>
Creates a canonical element.
§Errors
Returns DbError::IdOverflow when element IDs are exhausted.
§Performance
This method is O(log element count).
Sourcepub fn create_relation(&mut self) -> Result<RelationId, DbError>
pub fn create_relation(&mut self) -> Result<RelationId, DbError>
Creates a canonical relation.
§Errors
Returns DbError::IdOverflow when relation IDs are exhausted.
§Performance
This method is O(log relation count).
Sourcepub fn create_incidence(
&mut self,
relation: RelationId,
element: ElementId,
role: RoleId,
) -> Result<IncidenceId, DbError>
pub fn create_incidence( &mut self, relation: RelationId, element: ElementId, role: RoleId, ) -> Result<IncidenceId, DbError>
Sourcepub fn tombstone_element(&mut self, id: ElementId) -> Result<(), DbError>
pub fn tombstone_element(&mut self, id: ElementId) -> Result<(), DbError>
Tombstones a canonical element and its incidences.
§Errors
Returns DbError::UnknownElement when the element is not visible.
§Performance
This method is O(incidence count).
Sourcepub fn tombstone_relation(&mut self, id: RelationId) -> Result<(), DbError>
pub fn tombstone_relation(&mut self, id: RelationId) -> Result<(), DbError>
Tombstones a canonical relation and its incidences.
§Errors
Returns DbError::UnknownRelation when the relation is not visible.
§Performance
This method is O(incidence count).
Sourcepub fn tombstone_incidence(&mut self, id: IncidenceId) -> Result<(), DbError>
pub fn tombstone_incidence(&mut self, id: IncidenceId) -> Result<(), DbError>
Tombstones a canonical incidence.
§Errors
Returns DbError::UnknownIncidence when the incidence is not visible.
§Performance
This method is O(log incidence count).
Sourcepub fn add_element_label(
&mut self,
element: ElementId,
label: LabelId,
) -> Result<(), DbError>
pub fn add_element_label( &mut self, element: ElementId, label: LabelId, ) -> Result<(), DbError>
Sourcepub fn add_relation_label(
&mut self,
relation: RelationId,
label: LabelId,
) -> Result<(), DbError>
pub fn add_relation_label( &mut self, relation: RelationId, label: LabelId, ) -> Result<(), DbError>
Sourcepub fn set_relation_type(
&mut self,
relation: RelationId,
relation_type: RelationTypeId,
) -> Result<(), DbError>
pub fn set_relation_type( &mut self, relation: RelationId, relation_type: RelationTypeId, ) -> Result<(), DbError>
Sourcepub fn set_property(
&mut self,
subject: PropertySubject,
key: PropertyKeyId,
value: PropertyValue,
) -> Result<(), DbError>
pub fn set_property( &mut self, subject: PropertySubject, key: PropertyKeyId, value: PropertyValue, ) -> Result<(), DbError>
Sourcepub fn remove_property(
&mut self,
subject: PropertySubject,
key: PropertyKeyId,
) -> Result<(), DbError>
pub fn remove_property( &mut self, subject: PropertySubject, key: PropertyKeyId, ) -> Result<(), DbError>
Auto Trait Implementations§
impl<'db> Freeze for WriteTransaction<'db>
impl<'db> RefUnwindSafe for WriteTransaction<'db>
impl<'db> Send for WriteTransaction<'db>
impl<'db> Sync for WriteTransaction<'db>
impl<'db> Unpin for WriteTransaction<'db>
impl<'db> UnsafeUnpin for WriteTransaction<'db>
impl<'db> !UnwindSafe for WriteTransaction<'db>
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