pub struct RepresentationDomain { /* private fields */ }Expand description
Legal values of a custom conversion’s scalar representation.
Implementations§
Source§impl RepresentationDomain
impl RepresentationDomain
pub fn range<T: DomainScalar, R: RangeBounds<T>>(range: R) -> Self
pub fn values<T: DomainScalar>(values: impl IntoIterator<Item = T>) -> Self
pub fn exclude<T: DomainScalar>(&mut self, values: impl IntoIterator<Item = T>)
pub fn ty(&self) -> &Type
Sourcepub fn contains_expr(&self, value: TokenStream) -> TokenStream
pub fn contains_expr(&self, value: TokenStream) -> TokenStream
An expression testing whether value lies inside the legal domain —
what a generated bounds check is built from.
Sourcepub fn niche_values(&self, limit: usize) -> Vec<ScalarValue>
pub fn niche_values(&self, limit: usize) -> Vec<ScalarValue>
Derive a bounded number of stable values outside the legal domain.
Adapter-facing, with ScalarValue::portable_expr: a back-end that
gives a sum type a niche-based ABI needs the values to reserve.
Trait Implementations§
Source§impl Clone for RepresentationDomain
impl Clone for RepresentationDomain
Source§fn clone(&self) -> RepresentationDomain
fn clone(&self) -> RepresentationDomain
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 moreAuto Trait Implementations§
impl !Send for RepresentationDomain
impl !Sync for RepresentationDomain
impl Freeze for RepresentationDomain
impl RefUnwindSafe for RepresentationDomain
impl Unpin for RepresentationDomain
impl UnsafeUnpin for RepresentationDomain
impl UnwindSafe for RepresentationDomain
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<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