[−][src]Struct rql::TableGuardMut
A mutable guard to a Table
Methods
impl<'a, T> TableGuardMut<'a, T> where
T: Serialize,
[src]
T: Serialize,
Methods from Deref<Target = Table<T>>
pub fn len(&self) -> usize
[src]
Get the number of rows in the Table
pub fn is_empty(&self) -> bool
[src]
Check if the Table` is empty
pub fn insert(&mut self, row: T) -> Id<T>
[src]
Insert a row into the Table
pub fn get(&self, id: Id<T>) -> Option<&T>
[src]
Try to get a reference to the row with the given Id
pub fn get_mut(&mut self, id: Id<T>) -> Option<&mut T>
[src]
Try to get a mutable reference to the row with the given Id
pub fn remove(&mut self, id: Id<T>) -> Option<T>
[src]
Remove the row with the given Id
pub fn rows(&self) -> RowIter<T>
[src]
Iterate over all rows in the Table
pub fn rows_mut(&mut self) -> RowIterMut<T>
[src]
Iterate mutably over all rows in the Table
pub fn delete_one(&mut self, id: Id<T>) -> Option<T>
[src]
Delete a single row based on its Id
and return the value
pub fn delete_where<F>(&mut self, f: F) -> usize where
F: Fn(&T) -> bool,
[src]
F: Fn(&T) -> bool,
Delete rows that satisfy the clause
Returns how many rows where deleted
pub fn delete_iter<'a, F, I, R>(&'a mut self, f: F) where
F: Fn(&'a Self) -> I,
I: IntoIterator<Item = R>,
R: Idd<RowType = T>,
[src]
F: Fn(&'a Self) -> I,
I: IntoIterator<Item = R>,
R: Idd<RowType = T>,
Delete rows with ids returned by an iterator
pub fn save<P>(&self, path: P, repr: Representation) -> Result<()> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Save the database to a file
pub fn save_to_bytes(&self, repr: Representation) -> Result<Vec<u8>>
[src]
Save the database to a byte vector
Trait Implementations
impl<'a, T: Debug> Debug for TableGuardMut<'a, T> where
T: Serialize,
[src]
T: Serialize,
impl<'a, T> Deref for TableGuardMut<'a, T> where
T: Serialize,
[src]
T: Serialize,
impl<'a, T> DerefMut for TableGuardMut<'a, T> where
T: Serialize,
[src]
T: Serialize,
impl<'a, T> Drop for TableGuardMut<'a, T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for TableGuardMut<'a, T>
impl<'a, T> !Send for TableGuardMut<'a, T>
impl<'a, T> Sync for TableGuardMut<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for TableGuardMut<'a, T>
impl<'a, T> UnwindSafe for TableGuardMut<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,