pub struct Boolean;Expand description
Value schema that stores boolean flags as either all-zero or all-one bit patterns.
Storing false as 0x00 and true as 0xFF in every byte makes it trivial to
distinguish the two cases while leaving room for future SIMD optimisations when
scanning large collections of flags.
Trait Implementations§
Source§impl ConstDescribe for Boolean
impl ConstDescribe for Boolean
Source§impl<'a> TryFromValue<'a, Boolean> for bool
impl<'a> TryFromValue<'a, Boolean> for bool
Source§impl TryToValue<Boolean> for &bool
impl TryToValue<Boolean> for &bool
Source§impl TryToValue<Boolean> for bool
impl TryToValue<Boolean> for bool
Source§impl ValueSchema for Boolean
impl ValueSchema for Boolean
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 Boolean
impl RefUnwindSafe for Boolean
impl Send for Boolean
impl Sync for Boolean
impl Unpin for Boolean
impl UnsafeUnpin for Boolean
impl UnwindSafe for Boolean
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