pub struct Extensible<T: 'static> {
pub constraint: T,
pub extensible: Option<&'static [T]>,
}Expand description
A wrapper around Constraint covering whether the constraint is “extensible”.
Extensible means that it can have values outside of its constraints, and what possible constraints thosevalues in the extended set can have, if any.
Fields§
§constraint: TThe underlying constraint type.
extensible: Option<&'static [T]>Whether the constraint is extensible, and if it is, a list of extensible constraints. Extensibility means that the allowed constraint values can change, not type of the constraint itself.
Implementations§
Source§impl<T> Extensible<T>
impl<T> Extensible<T>
Sourcepub const fn new(constraint: T) -> Self
pub const fn new(constraint: T) -> Self
Creates a new wrapper around a given constraint, by default this means that the underlying constraint is not extensible.
Sourcepub const fn new_extensible(constraint: T, constraints: &'static [T]) -> Self
pub const fn new_extensible(constraint: T, constraints: &'static [T]) -> Self
Creates a new extensible constraint with a given set of constraints on the extended values.
Sourcepub const fn set_extensible(self, extensible: bool) -> Self
pub const fn set_extensible(self, extensible: bool) -> Self
Sets the constraint to be extensible with no constraints on extended values.
Sourcepub const fn extensible_with_constraints(
self,
constraints: Option<&'static [T]>,
) -> Self
pub const fn extensible_with_constraints( self, constraints: Option<&'static [T]>, ) -> Self
Sets the constraint to either not be extended or extensible with a set of constraints.
Source§impl Extensible<Value>
impl Extensible<Value>
Source§impl Extensible<Size>
impl Extensible<Size>
Trait Implementations§
Source§impl<T: Clone + 'static> Clone for Extensible<T>
impl<T: Clone + 'static> Clone for Extensible<T>
Source§fn clone(&self) -> Extensible<T>
fn clone(&self) -> Extensible<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug + 'static> Debug for Extensible<T>
impl<T: Debug + 'static> Debug for Extensible<T>
Source§impl<T: Default + 'static> Default for Extensible<T>
impl<T: Default + 'static> Default for Extensible<T>
Source§fn default() -> Extensible<T>
fn default() -> Extensible<T>
Source§impl From<Extensible<PermittedAlphabet>> for Constraint
impl From<Extensible<PermittedAlphabet>> for Constraint
Source§fn from(size: Extensible<PermittedAlphabet>) -> Self
fn from(size: Extensible<PermittedAlphabet>) -> Self
Source§impl From<Extensible<Size>> for Constraint
impl From<Extensible<Size>> for Constraint
Source§fn from(size: Extensible<Size>) -> Self
fn from(size: Extensible<Size>) -> Self
Source§impl From<Extensible<Value>> for Constraint
impl From<Extensible<Value>> for Constraint
Source§fn from(size: Extensible<Value>) -> Self
fn from(size: Extensible<Value>) -> Self
Source§impl From<PermittedAlphabet> for Extensible<PermittedAlphabet>
impl From<PermittedAlphabet> for Extensible<PermittedAlphabet>
Source§fn from(value: PermittedAlphabet) -> Self
fn from(value: PermittedAlphabet) -> Self
Source§impl<T: PartialEq + 'static> PartialEq for Extensible<T>
impl<T: PartialEq + 'static> PartialEq for Extensible<T>
impl<T: Copy + 'static> Copy for Extensible<T>
impl<T: 'static> StructuralPartialEq for Extensible<T>
Auto Trait Implementations§
impl<T> Freeze for Extensible<T>where
T: Freeze,
impl<T> RefUnwindSafe for Extensible<T>where
T: RefUnwindSafe,
impl<T> Send for Extensible<T>
impl<T> Sync for Extensible<T>where
T: Sync,
impl<T> Unpin for Extensible<T>where
T: Unpin,
impl<T> UnwindSafe for Extensible<T>where
T: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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>
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>
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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.