pub struct ParameterValue(/* private fields */);Expand description
A bounded typed job-parameter value.
Debug and Display intentionally redact the underlying value. Use the
typed accessors only at an application or persistence boundary that is
authorized to consume the parameter.
Implementations§
Source§impl ParameterValue
impl ParameterValue
Sourcepub fn string(value: impl Into<String>) -> Result<ParameterValue, DomainError>
pub fn string(value: impl Into<String>) -> Result<ParameterValue, DomainError>
Validates and constructs a string parameter.
§Errors
Returns DomainError::ParameterStringTooLong when the UTF-8 value is
larger than 64 KiB.
Sourcepub const fn kind(&self) -> ParameterValueKind
pub const fn kind(&self) -> ParameterValueKind
Returns the stable type discriminator.
Sourcepub const fn as_i64(&self) -> Option<i64>
pub const fn as_i64(&self) -> Option<i64>
Returns the signed integer when this is an i64 parameter.
Trait Implementations§
Source§impl Clone for ParameterValue
impl Clone for ParameterValue
Source§fn clone(&self) -> ParameterValue
fn clone(&self) -> ParameterValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParameterValue
impl Debug for ParameterValue
Source§impl Display for ParameterValue
impl Display for ParameterValue
impl Eq for ParameterValue
Source§impl From<bool> for ParameterValue
impl From<bool> for ParameterValue
Source§fn from(value: bool) -> ParameterValue
fn from(value: bool) -> ParameterValue
Converts to this type from the input type.
Source§impl From<i64> for ParameterValue
impl From<i64> for ParameterValue
Source§fn from(value: i64) -> ParameterValue
fn from(value: i64) -> ParameterValue
Converts to this type from the input type.
Source§impl From<u64> for ParameterValue
impl From<u64> for ParameterValue
Source§fn from(value: u64) -> ParameterValue
fn from(value: u64) -> ParameterValue
Converts to this type from the input type.
Source§impl Hash for ParameterValue
impl Hash for ParameterValue
Source§impl Ord for ParameterValue
impl Ord for ParameterValue
Source§fn cmp(&self, other: &ParameterValue) -> Ordering
fn cmp(&self, other: &ParameterValue) -> Ordering
1.21.0 (const: unstable) · 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 PartialEq for ParameterValue
impl PartialEq for ParameterValue
Source§impl PartialOrd for ParameterValue
impl PartialOrd for ParameterValue
impl StructuralPartialEq for ParameterValue
Source§impl TryFrom<&str> for ParameterValue
impl TryFrom<&str> for ParameterValue
Source§type Error = DomainError
type Error = DomainError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &str,
) -> Result<ParameterValue, <ParameterValue as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<ParameterValue, <ParameterValue as TryFrom<&str>>::Error>
Performs the conversion.
Source§impl TryFrom<String> for ParameterValue
impl TryFrom<String> for ParameterValue
Source§type Error = DomainError
type Error = DomainError
The type returned in the event of a conversion error.
Source§fn try_from(
value: String,
) -> Result<ParameterValue, <ParameterValue as TryFrom<String>>::Error>
fn try_from( value: String, ) -> Result<ParameterValue, <ParameterValue as TryFrom<String>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for ParameterValue
impl RefUnwindSafe for ParameterValue
impl Send for ParameterValue
impl Sync for ParameterValue
impl Unpin for ParameterValue
impl UnsafeUnpin for ParameterValue
impl UnwindSafe for ParameterValue
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<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§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