pub struct Boolean;Expand description
Inline 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 Encodes<&bool> for Boolean
impl Encodes<&bool> for Boolean
Source§impl Encodes<bool> for Boolean
impl Encodes<bool> for Boolean
Source§impl InlineEncoding for Boolean
impl InlineEncoding for Boolean
Source§type Encoding = Boolean
type Encoding = Boolean
The trait parameter to dispatch via for
entity!{} field
conversion. For inline schemas (32-byte data lives in the
trible), set Encoding = Self — sources convert via
IntoEncoded<Self> { Output = Inline<Self> }. For
Handle<T>, set
Encoding = T — sources convert via IntoEncoded<T> { Output = Blob<T> }. The BlobEncoding T sitting directly at trait
position 0 is what lets downstream impl IntoEncoded<MyBlob> for MyType without bumping into the orphan rule.Source§fn validate(value: Inline<Self>) -> Result<Inline<Self>, Self::ValidationError>
fn validate(value: Inline<Self>) -> Result<Inline<Self>, Self::ValidationError>
Check if the given value conforms to this schema.
Source§fn inline_from<T: IntoInline<Self>>(t: T) -> Inline<Self>
fn inline_from<T: IntoInline<Self>>(t: T) -> Inline<Self>
Create a new value from a concrete Rust type via
IntoInline.
Panics if the underlying conversion panics.Source§fn inline_try_from<T: TryToInline<Self>>(
t: T,
) -> Result<Inline<Self>, <T as TryToInline<Self>>::Error>
fn inline_try_from<T: TryToInline<Self>>( t: T, ) -> Result<Inline<Self>, <T as TryToInline<Self>>::Error>
Create a new value from a concrete Rust type via
TryToInline.
Returns an error if the conversion fails.Source§impl MetaDescribe for Boolean
impl MetaDescribe for Boolean
Source§fn id() -> Id
fn id() -> Id
Returns the id of this type. Default: derive from
Self::describe().root(). Impls choose whether the id is
explicit (an entity!{ &id_hex @ … } form inside describe)
or derived (no @, intrinsic id from the facts) — either
way the default reads the root the fragment carries. Read moreSource§impl<'a> TryFromInline<'a, Boolean> for bool
impl<'a> TryFromInline<'a, Boolean> for bool
Source§impl TryToInline<Boolean> for &bool
impl TryToInline<Boolean> for &bool
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<S> Encodes<&Inline<S>> for Swhere
S: InlineEncoding,
impl<S> Encodes<&Inline<S>> for Swhere
S: InlineEncoding,
Source§impl<S> Encodes<Inline<S>> for Swhere
S: InlineEncoding,
impl<S> Encodes<Inline<S>> for Swhere
S: InlineEncoding,
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 moreSource§impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
Source§fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
Run the conversion.