pub struct PkSet { /* private fields */ }Expand description
Selected primary keys, each typed from the model’s PK field, so a key can never be bound against a PK column of another type (#1817).
Implementations§
Source§impl PkSet
impl PkSet
Sourcepub const MAX_KEYS: usize = 10_000
pub const MAX_KEYS: usize = 10_000
Most keys one set holds: one IN list stays under every
backend’s bind cap (SQLite: 32766).
Sourcepub fn parse<S: AsRef<str>>(
model: &'static ModelSchema,
raw: impl IntoIterator<Item = S>,
) -> Result<Self, BulkActionError>
pub fn parse<S: AsRef<str>>( model: &'static ModelSchema, raw: impl IntoIterator<Item = S>, ) -> Result<Self, BulkActionError>
Parse raw keys (form or URL values) with the PK field’s type.
§Errors
BulkActionError::InvalidPk when the model has no PK, a key
does not parse as its type, or past Self::MAX_KEYS keys.
Sourcepub fn new<V: Into<SqlValue>>(
model: &'static ModelSchema,
keys: impl IntoIterator<Item = V>,
) -> Result<Self, BulkActionError>
pub fn new<V: Into<SqlValue>>( model: &'static ModelSchema, keys: impl IntoIterator<Item = V>, ) -> Result<Self, BulkActionError>
Typed keys. Integers are narrowed to the PK’s width; any other type mismatch is refused.
§Errors
BulkActionError::InvalidPk when the model has no PK, a key
does not fit its type, or past Self::MAX_KEYS keys.
Sourcepub fn model(&self) -> &'static ModelSchema
pub fn model(&self) -> &'static ModelSchema
The model the keys belong to.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PkSet
impl RefUnwindSafe for PkSet
impl Send for PkSet
impl Sync for PkSet
impl Unpin for PkSet
impl UnsafeUnpin for PkSet
impl UnwindSafe for PkSet
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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