pub struct ResolvedFkRef {
pub child_table: Arc<BTreeTable>,
pub fk: Arc<ForeignKey>,
pub parent_cols: Box<[String]>,
pub child_pos: BoxedSlice<usize>,
pub parent_pos: BoxedSlice<usize>,
pub parent_uses_rowid: bool,
pub parent_unique_index: Option<Arc<Index>>,
}Expand description
A single resolved foreign key where parent_table == target.
Child column names live in fk.child_columns — not duplicated here.
Fields§
§child_table: Arc<BTreeTable>Child table that owns the FK.
fk: Arc<ForeignKey>The FK as declared on the child table.
parent_cols: Box<[String]>Resolved parent columns: either fk.parent_columns or, when that is
empty, the parent table’s PRIMARY KEY columns. Always non-empty.
child_pos: BoxedSlice<usize>Column positions in the child/parent tables (pos_in_table)
parent_pos: BoxedSlice<usize>§parent_uses_rowid: boolIf the parent key is rowid or a rowid-alias (single-column only)
parent_unique_index: Option<Arc<Index>>For non-rowid parents: the UNIQUE index that enforces the parent key.
(None when parent_uses_rowid == true.)
Implementations§
Source§impl ResolvedFkRef
impl ResolvedFkRef
Sourcepub fn parent_key_may_change(
&self,
updated_parent_positions: &ColumnMask,
parent_tbl: &BTreeTable,
) -> Result<bool>
pub fn parent_key_may_change( &self, updated_parent_positions: &ColumnMask, parent_tbl: &BTreeTable, ) -> Result<bool>
Returns if any referenced parent column can change when these column positions are updated.
Sourcepub fn child_key_changed(
&self,
updated_child_positions: &ColumnMask,
child_tbl: &BTreeTable,
) -> bool
pub fn child_key_changed( &self, updated_child_positions: &ColumnMask, child_tbl: &BTreeTable, ) -> bool
Returns if any child column of this FK is in updated_child_positions
Trait Implementations§
Source§impl Clone for ResolvedFkRef
impl Clone for ResolvedFkRef
Source§fn clone(&self) -> ResolvedFkRef
fn clone(&self) -> ResolvedFkRef
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for ResolvedFkRef
impl !UnwindSafe for ResolvedFkRef
impl Freeze for ResolvedFkRef
impl Send for ResolvedFkRef
impl Sync for ResolvedFkRef
impl Unpin for ResolvedFkRef
impl UnsafeUnpin for ResolvedFkRef
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more