Skip to main content

BlockRepository

Struct BlockRepository 

Source
pub struct BlockRepository<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> BlockRepository<'a>

Source

pub fn new( redb_table: Box<dyn BlockTable + 'a>, transaction: &'a Transaction, ) -> Self

Source

pub fn create_orphan( &mut self, event_buffer: &mut EventBuffer, entity: &Block, ) -> Result<Block, RepositoryError>

Source

pub fn create_orphan_multi( &mut self, event_buffer: &mut EventBuffer, entities: &[Block], ) -> Result<Vec<Block>, RepositoryError>

Source

pub fn create( &mut self, event_buffer: &mut EventBuffer, entity: &Block, owner_id: EntityId, index: i32, ) -> Result<Block, RepositoryError>

Source

pub fn create_multi( &mut self, event_buffer: &mut EventBuffer, entities: &[Block], owner_id: EntityId, index: i32, ) -> Result<Vec<Block>, RepositoryError>

Source

pub fn get(&self, id: &EntityId) -> Result<Option<Block>, RepositoryError>

Source

pub fn get_multi( &self, ids: &[EntityId], ) -> Result<Vec<Option<Block>>, RepositoryError>

Source

pub fn get_all(&self) -> Result<Vec<Block>, RepositoryError>

Source

pub fn update( &mut self, event_buffer: &mut EventBuffer, entity: &Block, ) -> Result<Block, RepositoryError>

Source

pub fn update_multi( &mut self, event_buffer: &mut EventBuffer, entities: &[Block], ) -> Result<Vec<Block>, RepositoryError>

Source

pub fn update_with_relationships( &mut self, event_buffer: &mut EventBuffer, entity: &Block, ) -> Result<Block, RepositoryError>

Source

pub fn update_with_relationships_multi( &mut self, event_buffer: &mut EventBuffer, entities: &[Block], ) -> Result<Vec<Block>, RepositoryError>

Source

pub fn remove( &mut self, event_buffer: &mut EventBuffer, id: &EntityId, ) -> Result<(), RepositoryError>

Source

pub fn remove_multi( &mut self, event_buffer: &mut EventBuffer, ids: &[EntityId], ) -> Result<(), RepositoryError>

Source

pub fn get_relationship( &self, id: &EntityId, field: &BlockRelationshipField, ) -> Result<Vec<EntityId>, RepositoryError>

Source

pub fn get_relationship_many( &self, ids: &[EntityId], field: &BlockRelationshipField, ) -> Result<HashMap<EntityId, Vec<EntityId>>, RepositoryError>

Source

pub fn get_relationship_count( &self, id: &EntityId, field: &BlockRelationshipField, ) -> Result<usize, RepositoryError>

Source

pub fn get_relationship_in_range( &self, id: &EntityId, field: &BlockRelationshipField, offset: usize, limit: usize, ) -> Result<Vec<EntityId>, RepositoryError>

Source

pub fn get_relationships_from_right_ids( &self, field: &BlockRelationshipField, right_ids: &[EntityId], ) -> Result<Vec<(EntityId, Vec<EntityId>)>, RepositoryError>

Source

pub fn set_relationship_multi( &mut self, event_buffer: &mut EventBuffer, field: &BlockRelationshipField, relationships: Vec<(EntityId, Vec<EntityId>)>, ) -> Result<(), RepositoryError>

Source

pub fn set_relationship( &mut self, event_buffer: &mut EventBuffer, id: &EntityId, field: &BlockRelationshipField, right_ids: &[EntityId], ) -> Result<(), RepositoryError>

Source

pub fn move_relationship_ids( &mut self, event_buffer: &mut EventBuffer, id: &EntityId, field: &BlockRelationshipField, ids_to_move: &[EntityId], new_index: i32, ) -> Result<Vec<EntityId>, RepositoryError>

Source

pub fn get_relationships_from_owner( &self, owner_id: &EntityId, ) -> Result<Vec<EntityId>, RepositoryError>

Source

pub fn set_relationships_in_owner( &mut self, event_buffer: &mut EventBuffer, owner_id: &EntityId, ids: &[EntityId], ) -> Result<(), RepositoryError>

Source

pub fn snapshot( &self, ids: &[EntityId], ) -> Result<EntityTreeSnapshot, RepositoryError>

Source

pub fn restore( &mut self, event_buffer: &mut EventBuffer, snap: &EntityTreeSnapshot, ) -> Result<(), RepositoryError>

Auto Trait Implementations§

§

impl<'a> Freeze for BlockRepository<'a>

§

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

§

impl<'a> !Send for BlockRepository<'a>

§

impl<'a> !Sync for BlockRepository<'a>

§

impl<'a> Unpin for BlockRepository<'a>

§

impl<'a> UnsafeUnpin for BlockRepository<'a>

§

impl<'a> !UnwindSafe for BlockRepository<'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, 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, 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.