pub struct ConvertDecl { /* private fields */ }Implementations§
Source§impl ConvertDecl
impl ConvertDecl
Sourcepub fn describe_sources(&self) -> String
pub fn describe_sources(&self) -> String
: input …, output … suffix for the report’s conversions section.
pub fn new(rust_type: Type) -> ConvertDecl
Sourcepub fn rust_type(&self) -> &Origin<Type>
pub fn rust_type(&self) -> &Origin<Type>
The type this declaration was written with, as originally parsed.
Sourcepub fn input_spec(&self) -> &Option<ConvertSpec>
pub fn input_spec(&self) -> &Option<ConvertSpec>
The declared into-Rust conversion source, if any. Named
input_spec rather than input — that name is already the builder
method that declares it (Self::input).
Sourcepub fn output_spec(&self) -> &Option<ConvertSpec>
pub fn output_spec(&self) -> &Option<ConvertSpec>
The declared out-of-Rust conversion source, if any. Named
output_spec rather than output — that name is already the builder
method that declares it (Self::output).
Sourcepub fn domain(&self) -> &Option<RepresentationDomain>
pub fn domain(&self) -> &Option<RepresentationDomain>
The declared representation-domain restriction, if any.
Sourcepub fn locals(&self) -> &[(Ident, Path, Signature)]
pub fn locals(&self) -> &[(Ident, Path, Signature)]
Binding-local fn sources declared on this convert, drained into the synthesis pre-pass at acceptance.
Sourcepub fn locals_mut(&mut self) -> &mut Vec<(Ident, Path, Signature)>
pub fn locals_mut(&mut self) -> &mut Vec<(Ident, Path, Signature)>
Mutable access for draining binding-local fn sources into the
synthesis pre-pass at acceptance (Vec::append).
Sourcepub fn input(self, src: impl Into<ConvertSourceDecl>) -> ConvertDecl
pub fn input(self, src: impl Into<ConvertSourceDecl>) -> ConvertDecl
Sourcepub fn output(self, src: impl Into<ConvertSourceDecl>) -> ConvertDecl
pub fn output(self, src: impl Into<ConvertSourceDecl>) -> ConvertDecl
Sourcepub fn valid_range<T, R>(self, range: R) -> ConvertDeclwhere
T: DomainScalar,
R: RangeBounds<T>,
pub fn valid_range<T, R>(self, range: R) -> ConvertDeclwhere
T: DomainScalar,
R: RangeBounds<T>,
Restrict the scalar representation to a numeric range. Values outside
the range are rejected and may be reused by wrappers such as Option.
Floating-point ranges reject every NaN; use Self::valid_values when
exact raw IEEE values (including a specific NaN payload) are intended.
Sourcepub fn valid_values<T>(self, values: impl IntoIterator<Item = T>) -> ConvertDeclwhere
T: DomainScalar,
pub fn valid_values<T>(self, values: impl IntoIterator<Item = T>) -> ConvertDeclwhere
T: DomainScalar,
Restrict the scalar representation to a finite valid-value set. Float
membership uses raw IEEE bits, so 0.0, -0.0, and NaN payloads remain
distinct.
Sourcepub fn exclude_values<T>(
self,
values: impl IntoIterator<Item = T>,
) -> ConvertDeclwhere
T: DomainScalar,
pub fn exclude_values<T>(
self,
values: impl IntoIterator<Item = T>,
) -> ConvertDeclwhere
T: DomainScalar,
Remove finite values from the previously declared base domain. Float exclusions use raw IEEE bits.
Trait Implementations§
Source§impl Clone for ConvertDecl
impl Clone for ConvertDecl
Source§fn clone(&self) -> ConvertDecl
fn clone(&self) -> ConvertDecl
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Send for ConvertDecl
impl !Sync for ConvertDecl
impl Freeze for ConvertDecl
impl RefUnwindSafe for ConvertDecl
impl Unpin for ConvertDecl
impl UnsafeUnpin for ConvertDecl
impl UnwindSafe for ConvertDecl
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
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> ⓘ
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> ⓘ
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