pub struct EntityCollection<T> { /* private fields */ }Available on crate feature
std only.Expand description
Generic DDL entity collection with typed operations.
See module docs for the design rationale. Per-dialect impl EntityCollection<…> blocks supplying entity-aware lookups live in
sqlite/collection.rs and postgres/collection.rs.
Implementations§
Source§impl<T> EntityCollection<T>
impl<T> EntityCollection<T>
Sourcepub const fn new() -> EntityCollection<T>
pub const fn new() -> EntityCollection<T>
Create empty collection.
Source§impl<T> EntityCollection<T>where
T: Clone,
impl<T> EntityCollection<T>where
T: Clone,
Sourcepub fn update_where<F, P>(&mut self, predicate: P, transform: F)
pub fn update_where<F, P>(&mut self, predicate: P, transform: F)
Update entities matching predicate with transform.
Sourcepub fn update_all<F>(&mut self, transform: F)
pub fn update_all<F>(&mut self, transform: F)
Update every entity with transform.
Source§impl EntityCollection<Enum>
impl EntityCollection<Enum>
Source§impl EntityCollection<Table>
impl EntityCollection<Table>
Source§impl EntityCollection<Index>
impl EntityCollection<Index>
Source§impl EntityCollection<View>
impl EntityCollection<View>
Source§impl EntityCollection<Table>
impl EntityCollection<Table>
Source§impl EntityCollection<Index>
impl EntityCollection<Index>
Source§impl EntityCollection<ForeignKey>
impl EntityCollection<ForeignKey>
Sourcepub fn one(&self, name: &str) -> Option<&ForeignKey>
pub fn one(&self, name: &str) -> Option<&ForeignKey>
Find a foreign key by name
Sourcepub fn for_table(&self, table: &str) -> Vec<&ForeignKey>
pub fn for_table(&self, table: &str) -> Vec<&ForeignKey>
List foreign keys for a table
Source§impl EntityCollection<PrimaryKey>
impl EntityCollection<PrimaryKey>
Sourcepub fn for_table(&self, table: &str) -> Option<&PrimaryKey>
pub fn for_table(&self, table: &str) -> Option<&PrimaryKey>
Find a primary key by table
Source§impl EntityCollection<UniqueConstraint>
impl EntityCollection<UniqueConstraint>
Sourcepub fn one(&self, name: &str) -> Option<&UniqueConstraint>
pub fn one(&self, name: &str) -> Option<&UniqueConstraint>
Find by name
Sourcepub fn for_table(&self, table: &str) -> Vec<&UniqueConstraint>
pub fn for_table(&self, table: &str) -> Vec<&UniqueConstraint>
List for a table
Source§impl EntityCollection<CheckConstraint>
impl EntityCollection<CheckConstraint>
Sourcepub fn one(&self, name: &str) -> Option<&CheckConstraint>
pub fn one(&self, name: &str) -> Option<&CheckConstraint>
Find by name
Sourcepub fn for_table(&self, table: &str) -> Vec<&CheckConstraint>
pub fn for_table(&self, table: &str) -> Vec<&CheckConstraint>
List for a table
Trait Implementations§
Source§impl<T> Clone for EntityCollection<T>where
T: Clone,
impl<T> Clone for EntityCollection<T>where
T: Clone,
Source§fn clone(&self) -> EntityCollection<T>
fn clone(&self) -> EntityCollection<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for EntityCollection<T>where
T: Debug,
impl<T> Debug for EntityCollection<T>where
T: Debug,
Source§impl<T> Default for EntityCollection<T>
impl<T> Default for EntityCollection<T>
Source§fn default() -> EntityCollection<T>
fn default() -> EntityCollection<T>
Returns the “default value” for a type. Read more
Source§impl<T> Extend<T> for EntityCollection<T>
impl<T> Extend<T> for EntityCollection<T>
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<T> Freeze for EntityCollection<T>
impl<T> RefUnwindSafe for EntityCollection<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for EntityCollection<T>
impl<T> Sync for EntityCollection<T>
impl<T> Unpin for EntityCollection<T>
impl<T> UnsafeUnpin for EntityCollection<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for EntityCollection<T>where
Vec<T>: UnwindSafe,
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