pub struct RowIdentity(/* private fields */);Expand description
The identity a client sees for a row.
A minted row renders its surrogate in decimal. A row with a declared
PRIMARY KEY carries the user’s own value.
Implementations§
Source§impl RowIdentity
impl RowIdentity
Sourcepub fn for_surrogate(surrogate: Surrogate) -> Self
pub fn for_surrogate(surrogate: Surrogate) -> Self
The decimal identity of a minted row.
Sourcepub fn of_stored_row(
body: &[u8],
declared_primary_key: Option<&str>,
key: StorageKey,
) -> RowIdentity
pub fn of_stored_row( body: &[u8], declared_primary_key: Option<&str>, key: StorageKey, ) -> RowIdentity
The identity INSERT mints for a row, applied to a stored body.
The identity column is declared_primary_key, else
DEFAULT_IDENTITY_COLUMN. A body carrying that column yields its
value. A body without it yields its ROWID_COLUMN value, and a body
with neither yields the decimal surrogate of key. A first write sets
_rowid to that same surrogate, so the two agree until a copy moves
the row to a new surrogate.
Sourcepub fn of_row_value(
row: &Value,
declared_primary_key: Option<&str>,
key: StorageKey,
) -> RowIdentity
pub fn of_row_value( row: &Value, declared_primary_key: Option<&str>, key: StorageKey, ) -> RowIdentity
Self::of_stored_row applied to a decoded row. A row that is not
an object yields the decimal surrogate of key. A scan that projects
the identity columns returns a row this reads the same identity from.
Sourcepub fn from_user_key(key: impl Into<String>) -> Self
pub fn from_user_key(key: impl Into<String>) -> Self
Wrap a declared or client-supplied key as the row’s identity.
The value is taken verbatim and never interpreted as a storage key or a surrogate. This is what makes it safe to call with a KV key, a user-declared primary key, or any other engine-native identifier.
Takes impl Into<String> so an owned String moves in without a
copy. A &str caller still pays one copy, which is unavoidable.
pub fn as_str(&self) -> &str
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consume this identity and return its inner String without copying.
Trait Implementations§
Source§impl Clone for RowIdentity
impl Clone for RowIdentity
Source§impl Debug for RowIdentity
impl Debug for RowIdentity
Source§impl Display for RowIdentity
impl Display for RowIdentity
impl Eq for RowIdentity
Source§impl Hash for RowIdentity
impl Hash for RowIdentity
Source§impl Ord for RowIdentity
impl Ord for RowIdentity
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RowIdentity
impl PartialEq for RowIdentity
Source§impl PartialOrd for RowIdentity
impl PartialOrd for RowIdentity
impl StructuralPartialEq for RowIdentity
Auto Trait Implementations§
impl Freeze for RowIdentity
impl RefUnwindSafe for RowIdentity
impl Send for RowIdentity
impl Sync for RowIdentity
impl Unpin for RowIdentity
impl UnsafeUnpin for RowIdentity
impl UnwindSafe for RowIdentity
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.