pub struct ShortString;Expand description
A value schema for a short string. A short string is a UTF-8 encoded string with a maximum length of 32 bytes (inclusive) The string is null-terminated. If the string is shorter than 32 bytes, the remaining bytes are zero. If the string is exactly 32 bytes, then there is no zero terminator.
Trait Implementations§
Source§impl ConstDescribe for ShortString
impl ConstDescribe for ShortString
Source§impl ToValue<ShortString> for &String
impl ToValue<ShortString> for &String
Source§impl ToValue<ShortString> for &str
impl ToValue<ShortString> for &str
Source§impl ToValue<ShortString> for String
impl ToValue<ShortString> for String
Source§impl<'a> TryFromValue<'a, ShortString> for &'a str
impl<'a> TryFromValue<'a, ShortString> for &'a str
Source§impl<'a> TryFromValue<'a, ShortString> for String
impl<'a> TryFromValue<'a, ShortString> for String
Source§impl TryToValue<ShortString> for &str
impl TryToValue<ShortString> for &str
Source§type Error = FromStrError
type Error = FromStrError
The error type returned when the conversion fails.
Source§fn try_to_value(self) -> Result<Value<ShortString>, Self::Error>
fn try_to_value(self) -> Result<Value<ShortString>, Self::Error>
Source§impl TryToValue<ShortString> for String
impl TryToValue<ShortString> for String
Source§type Error = FromStrError
type Error = FromStrError
The error type returned when the conversion fails.
Source§fn try_to_value(self) -> Result<Value<ShortString>, Self::Error>
fn try_to_value(self) -> Result<Value<ShortString>, Self::Error>
Source§impl ValueSchema for ShortString
impl ValueSchema for ShortString
Source§fn validate(value: Value<Self>) -> Result<Value<Self>, Self::ValidationError>
fn validate(value: Value<Self>) -> Result<Value<Self>, Self::ValidationError>
Check if the given value conforms to this schema.
Source§fn value_from<T: ToValue<Self>>(t: T) -> Value<Self>
fn value_from<T: ToValue<Self>>(t: T) -> Value<Self>
Source§fn value_try_from<T: TryToValue<Self>>(
t: T,
) -> Result<Value<Self>, <T as TryToValue<Self>>::Error>
fn value_try_from<T: TryToValue<Self>>( t: T, ) -> Result<Value<Self>, <T as TryToValue<Self>>::Error>
Create a new value from a concrete Rust type.
This is a convenience method that calls the TryToValue trait.
This method might return an error if the conversion is not possible. Read more
Auto Trait Implementations§
impl Freeze for ShortString
impl RefUnwindSafe for ShortString
impl Send for ShortString
impl Sync for ShortString
impl Unpin for ShortString
impl UnsafeUnpin for ShortString
impl UnwindSafe for ShortString
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> Describe for Twhere
T: ConstDescribe,
impl<T> Describe for Twhere
T: ConstDescribe,
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