Struct flux_middle::rty::AdtSortDef
source · pub struct AdtSortDef(Interned<AdtSortDefData>);
Expand description
The definition of the data sort automatically generated for a struct or enum.
Tuple Fields§
§0: Interned<AdtSortDefData>
Implementations§
source§impl AdtSortDef
impl AdtSortDef
pub fn new( def_id: DefId, params: Vec<ParamTy>, fields: Vec<(Symbol, Sort)>, ) -> Self
pub fn did(&self) -> DefId
pub fn fields(&self) -> usize
pub fn projections(&self) -> impl Iterator<Item = FieldProj> + '_
pub fn field_names(&self) -> &Vec<Symbol>
pub fn sort_by_field_name(&self, args: &[Sort]) -> FxIndexMap<Symbol, Sort>
pub fn field_by_name( &self, args: &[Sort], name: Symbol, ) -> Option<(FieldProj, Sort)>
pub fn field_sorts(&self, args: &[Sort]) -> List<Sort>
pub fn to_sort(&self, args: &[GenericArg]) -> Sort
sourcepub fn filter_generic_args<'a, A>(
&'a self,
args: &'a [A],
) -> impl Iterator<Item = &A> + 'a
pub fn filter_generic_args<'a, A>( &'a self, args: &'a [A], ) -> impl Iterator<Item = &A> + 'a
Given a list of generic args, returns an iterator of the generic arguments that should be mapped to sorts for instantiation.
pub fn identity_args(&self) -> List<Sort>
sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Gives the number of sort variables bound by this definition.
Trait Implementations§
source§impl Clone for AdtSortDef
impl Clone for AdtSortDef
source§fn clone(&self) -> AdtSortDef
fn clone(&self) -> AdtSortDef
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AdtSortDef
impl Debug for AdtSortDef
source§impl<__D: TyDecoder> Decodable<__D> for AdtSortDef
impl<__D: TyDecoder> Decodable<__D> for AdtSortDef
source§impl<__E: TyEncoder> Encodable<__E> for AdtSortDef
impl<__E: TyEncoder> Encodable<__E> for AdtSortDef
source§impl Hash for AdtSortDef
impl Hash for AdtSortDef
source§impl PartialEq for AdtSortDef
impl PartialEq for AdtSortDef
impl Eq for AdtSortDef
impl StructuralPartialEq for AdtSortDef
Auto Trait Implementations§
impl Freeze for AdtSortDef
impl RefUnwindSafe for AdtSortDef
impl Send for AdtSortDef
impl Sync for AdtSortDef
impl Unpin for AdtSortDef
impl UnwindSafe for AdtSortDef
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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