pub struct Sequence<T> { /* private fields */ }Expand description
A sequence checked against its exact resolved cardinality.
Implementations§
Source§impl<T> Sequence<T>
impl<T> Sequence<T>
Sourcepub fn try_new(
values: Vec<T>,
cardinality: Cardinality,
path: &ValidationPath,
) -> Result<Self, ValidationError>
pub fn try_new( values: Vec<T>, cardinality: Cardinality, path: &ValidationPath, ) -> Result<Self, ValidationError>
Validate and wrap a sequence against its resolved cardinality.
§Errors
Returns a stable validation error when the length cannot be represented
or falls outside cardinality.
Sourcepub const fn cardinality(&self) -> Cardinality
pub const fn cardinality(&self) -> Cardinality
Return the cardinality against which this sequence was validated.
Trait Implementations§
impl<T: PartialEq> StructuralPartialEq for Sequence<T>
Auto Trait Implementations§
impl<T> Freeze for Sequence<T>
impl<T> RefUnwindSafe for Sequence<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for Sequence<T>
impl<T> Sync for Sequence<T>
impl<T> Unpin for Sequence<T>
impl<T> UnsafeUnpin for Sequence<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for Sequence<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request