pub struct Storage { /* private fields */ }
Implementations§
Source§impl Storage
impl Storage
pub fn create(file: File, schema: &str) -> Result<Storage>
pub fn persist(&mut self) -> Result<()>
pub fn open(file: File) -> Result<Storage>
Sourcepub fn insert(&mut self, tuple: &mut Tuple) -> Result<(), SchemaError>
pub fn insert(&mut self, tuple: &mut Tuple) -> Result<(), SchemaError>
Insert does not allow duplicate key and inserts the Tuple in the set in a sorted way
Sourcepub fn append(&mut self, tuple: &mut Tuple) -> Result<(), SchemaError>
pub fn append(&mut self, tuple: &mut Tuple) -> Result<(), SchemaError>
Append allows duplicate key
Sourcepub fn update(&mut self, tuple: &mut Tuple) -> Result<usize, SchemaError>
pub fn update(&mut self, tuple: &mut Tuple) -> Result<usize, SchemaError>
Update all tuples matching the key
returns how many tuples were updated
Sourcepub fn remove_all(&mut self, filter: &Filter) -> usize
pub fn remove_all(&mut self, filter: &Filter) -> usize
Remove all tuples matching the key. Working from the end to the front of the Storage.
pub fn iter(&self) -> StorageIterator<'_>
pub fn get(&self, offset: u64) -> Option<Tuple>
pub fn create_filter(&self, filter: &str) -> Result<Filter, SchemaParseError>
pub fn schema_to_string(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
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