Struct sway_ir::metadata::MetadataIndex
source · pub struct MetadataIndex(pub Index);
Tuple Fields§
§0: Index
Implementations§
source§impl MetadataIndex
impl MetadataIndex
pub fn new_integer(context: &mut Context<'_>, int: u64) -> Self
pub fn new_index(context: &mut Context<'_>, idx: MetadataIndex) -> Self
pub fn new_source_id(context: &mut Context<'_>, id: SourceId) -> Self
pub fn new_string<S: Into<String>>(context: &mut Context<'_>, s: S) -> Self
pub fn new_struct<S: Into<String>>( context: &mut Context<'_>, tag: S, fields: Vec<Metadatum> ) -> Self
pub fn new_list(context: &mut Context<'_>, els: Vec<MetadataIndex>) -> Self
pub fn get_content<'a>(&self, context: &'a Context<'_>) -> &'a Metadatum
Trait Implementations§
source§impl Clone for MetadataIndex
impl Clone for MetadataIndex
source§fn clone(&self) -> MetadataIndex
fn clone(&self) -> MetadataIndex
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 MetadataIndex
impl Debug for MetadataIndex
source§impl Hash for MetadataIndex
impl Hash for MetadataIndex
source§impl Ord for MetadataIndex
impl Ord for MetadataIndex
source§fn cmp(&self, other: &MetadataIndex) -> Ordering
fn cmp(&self, other: &MetadataIndex) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<MetadataIndex> for MetadataIndex
impl PartialEq<MetadataIndex> for MetadataIndex
source§fn eq(&self, other: &MetadataIndex) -> bool
fn eq(&self, other: &MetadataIndex) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<MetadataIndex> for MetadataIndex
impl PartialOrd<MetadataIndex> for MetadataIndex
source§fn partial_cmp(&self, other: &MetadataIndex) -> Option<Ordering>
fn partial_cmp(&self, other: &MetadataIndex) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for MetadataIndex
impl Eq for MetadataIndex
impl StructuralEq for MetadataIndex
impl StructuralPartialEq for MetadataIndex
Auto Trait Implementations§
impl RefUnwindSafe for MetadataIndex
impl Send for MetadataIndex
impl Sync for MetadataIndex
impl Unpin for MetadataIndex
impl UnwindSafe for MetadataIndex
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more