pub struct Optional<T>(/* private fields */);Expand description
A datatype that represents an optional value.
Trait Implementations§
Source§impl Datatype for Optional<BigInt>
impl Datatype for Optional<BigInt>
type Inner = Optional<BigInt>
type Error = <Optional<BigInt> as FromStr>::Err
Source§fn validate(
input: Optional<BigInt>,
) -> Result<Self, <Optional<BigInt> as FromStr>::Err>
fn validate( input: Optional<BigInt>, ) -> Result<Self, <Optional<BigInt> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<Date>
impl Datatype for Optional<Date>
type Inner = Optional<Date>
type Error = <Optional<Date> as FromStr>::Err
Source§fn validate(
input: Optional<Date>,
) -> Result<Self, <Optional<Date> as FromStr>::Err>
fn validate( input: Optional<Date>, ) -> Result<Self, <Optional<Date> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<DateTime>
impl Datatype for Optional<DateTime>
type Inner = Optional<DateTime>
type Error = <Optional<DateTime> as FromStr>::Err
Source§fn validate(
input: Optional<DateTime>,
) -> Result<Self, <Optional<DateTime> as FromStr>::Err>
fn validate( input: Optional<DateTime>, ) -> Result<Self, <Optional<DateTime> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<BigRational>
impl Datatype for Optional<BigRational>
type Inner = Optional<Ratio<BigInt>>
type Error = <Optional<Ratio<BigInt>> as FromStr>::Err
Source§fn validate(
input: Optional<BigRational>,
) -> Result<Self, <Optional<BigRational> as FromStr>::Err>
fn validate( input: Optional<BigRational>, ) -> Result<Self, <Optional<BigRational> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<Time>
impl Datatype for Optional<Time>
type Inner = Optional<Time>
type Error = <Optional<Time> as FromStr>::Err
Source§fn validate(
input: Optional<Time>,
) -> Result<Self, <Optional<Time> as FromStr>::Err>
fn validate( input: Optional<Time>, ) -> Result<Self, <Optional<Time> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<i128>
impl Datatype for Optional<i128>
type Inner = Optional<i128>
type Error = <Optional<i128> as FromStr>::Err
Source§fn validate(
input: Optional<i128>,
) -> Result<Self, <Optional<i128> as FromStr>::Err>
fn validate( input: Optional<i128>, ) -> Result<Self, <Optional<i128> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<i16>
impl Datatype for Optional<i16>
type Inner = Optional<i16>
type Error = <Optional<i16> as FromStr>::Err
Source§fn validate(
input: Optional<i16>,
) -> Result<Self, <Optional<i16> as FromStr>::Err>
fn validate( input: Optional<i16>, ) -> Result<Self, <Optional<i16> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<i32>
impl Datatype for Optional<i32>
type Inner = Optional<i32>
type Error = <Optional<i32> as FromStr>::Err
Source§fn validate(
input: Optional<i32>,
) -> Result<Self, <Optional<i32> as FromStr>::Err>
fn validate( input: Optional<i32>, ) -> Result<Self, <Optional<i32> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<i64>
impl Datatype for Optional<i64>
type Inner = Optional<i64>
type Error = <Optional<i64> as FromStr>::Err
Source§fn validate(
input: Optional<i64>,
) -> Result<Self, <Optional<i64> as FromStr>::Err>
fn validate( input: Optional<i64>, ) -> Result<Self, <Optional<i64> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<i8>
impl Datatype for Optional<i8>
type Inner = Optional<i8>
type Error = <Optional<i8> as FromStr>::Err
Source§fn validate(input: Optional<i8>) -> Result<Self, <Optional<i8> as FromStr>::Err>
fn validate(input: Optional<i8>) -> Result<Self, <Optional<i8> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<u128>
impl Datatype for Optional<u128>
type Inner = Optional<u128>
type Error = <Optional<u128> as FromStr>::Err
Source§fn validate(
input: Optional<u128>,
) -> Result<Self, <Optional<u128> as FromStr>::Err>
fn validate( input: Optional<u128>, ) -> Result<Self, <Optional<u128> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<u16>
impl Datatype for Optional<u16>
type Inner = Optional<u16>
type Error = <Optional<u16> as FromStr>::Err
Source§fn validate(
input: Optional<u16>,
) -> Result<Self, <Optional<u16> as FromStr>::Err>
fn validate( input: Optional<u16>, ) -> Result<Self, <Optional<u16> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<u32>
impl Datatype for Optional<u32>
type Inner = Optional<u32>
type Error = <Optional<u32> as FromStr>::Err
Source§fn validate(
input: Optional<u32>,
) -> Result<Self, <Optional<u32> as FromStr>::Err>
fn validate( input: Optional<u32>, ) -> Result<Self, <Optional<u32> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<u64>
impl Datatype for Optional<u64>
type Inner = Optional<u64>
type Error = <Optional<u64> as FromStr>::Err
Source§fn validate(
input: Optional<u64>,
) -> Result<Self, <Optional<u64> as FromStr>::Err>
fn validate( input: Optional<u64>, ) -> Result<Self, <Optional<u64> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl Datatype for Optional<u8>
impl Datatype for Optional<u8>
type Inner = Optional<u8>
type Error = <Optional<u8> as FromStr>::Err
Source§fn validate(input: Optional<u8>) -> Result<Self, <Optional<u8> as FromStr>::Err>
fn validate(input: Optional<u8>) -> Result<Self, <Optional<u8> as FromStr>::Err>
Validate the input and return the datatype.
Source§fn attributes() -> Vec<(&'static str, Attribute)>
fn attributes() -> Vec<(&'static str, Attribute)>
Return the HTML attributes for the datatype that should be added to an input field.
Source§fn default_debug_value() -> Self
fn default_debug_value() -> Self
Debug value to autofill the form.
Source§impl<T: Ord> Ord for Optional<T>
impl<T: Ord> Ord for Optional<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for Optional<T>
impl<T: PartialOrd> PartialOrd for Optional<T>
impl<T: Eq> Eq for Optional<T>
impl<T> StructuralPartialEq for Optional<T>
Auto Trait Implementations§
impl<T> Freeze for Optional<T>where
T: Freeze,
impl<T> RefUnwindSafe for Optional<T>where
T: RefUnwindSafe,
impl<T> Send for Optional<T>where
T: Send,
impl<T> Sync for Optional<T>where
T: Sync,
impl<T> Unpin for Optional<T>where
T: Unpin,
impl<T> UnwindSafe for Optional<T>where
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> 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