pub trait IDbSet<T: IEntityType>:
IQueryable<T>
+ Send
+ Sync {
// Required methods
fn add(&mut self, entity: T);
fn remove_all(&mut self);
fn remove_at(&mut self, index: usize) -> EFResult<()>;
fn attach(&mut self, entity: T);
fn added_entities(&self) -> Vec<&T>;
fn modified_entities(&self) -> Vec<&T>;
fn deleted_entities(&self) -> Vec<&T>;
fn entries_with_state(&self) -> Vec<(&T, EntityState)>;
fn clear_entries(&mut self);
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
}Expand description
Interface for manipulating a typed entity collection.
Separates mutation concerns from query concerns (see IQueryable<T>).
Implemented by DbSet<T>.
Required Methods§
Sourcefn remove_all(&mut self)
fn remove_all(&mut self)
Marks all entities in the set as Deleted.
Sourcefn remove_at(&mut self, index: usize) -> EFResult<()>
fn remove_at(&mut self, index: usize) -> EFResult<()>
Marks the entity at the given index as Deleted.
Sourcefn added_entities(&self) -> Vec<&T>
fn added_entities(&self) -> Vec<&T>
Returns references to entities in Added state.
Sourcefn modified_entities(&self) -> Vec<&T>
fn modified_entities(&self) -> Vec<&T>
Returns references to entities in Modified state.
Sourcefn deleted_entities(&self) -> Vec<&T>
fn deleted_entities(&self) -> Vec<&T>
Returns references to entities in Deleted state.
Sourcefn entries_with_state(&self) -> Vec<(&T, EntityState)>
fn entries_with_state(&self) -> Vec<(&T, EntityState)>
Returns an iterator over entity references and their states.
Sourcefn clear_entries(&mut self)
fn clear_entries(&mut self)
Clears all tracked entries from the set.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".