Struct AttributeSet
pub struct AttributeSet { /* private fields */ }Expand description
An AttributeSet provides storage and access to all of the attributes attached to a Miden Assembly item, e.g. procedure definition.
Attributes are unique by name, so if you attempt to add multiple attributes with the same name, the last write wins. In Miden Assembly syntax, multiple key-value attributes are merged automatically, and a syntax error is only generated when keys conflict. All other attribute types produce an error if they are declared multiple times on the same item.
Implementations§
§impl AttributeSet
impl AttributeSet
pub fn new<I>(attrs: I) -> AttributeSetwhere
I: IntoIterator<Item = Attribute>,
pub fn new<I>(attrs: I) -> AttributeSetwhere
I: IntoIterator<Item = Attribute>,
Create a new AttributeSet from attrs
If the input attributes have duplicate entries for the same name, only one will be selected, but it is unspecified which.
pub fn get(&self, name: impl AsRef<str>) -> Option<&Attribute>
pub fn get(&self, name: impl AsRef<str>) -> Option<&Attribute>
Get the attribute named name, if one is present.
pub fn get_mut(&mut self, name: impl AsRef<str>) -> Option<&mut Attribute>
pub fn get_mut(&mut self, name: impl AsRef<str>) -> Option<&mut Attribute>
Get a mutable reference to the attribute named name, if one is present.
pub fn iter_mut(&mut self) -> IterMut<'_, Attribute>
pub fn iter_mut(&mut self) -> IterMut<'_, Attribute>
Get a mutable iterator over the attributes in this set
pub fn insert(&mut self, attr: Attribute) -> bool
pub fn insert(&mut self, attr: Attribute) -> bool
Insert attr in the attribute set, replacing any existing attribute with the same name
Returns true if the insertion was new, or false if the insertion replaced an existing entry.
pub fn insert_new(&mut self, attr: Attribute) -> Result<(), Attribute>
pub fn insert_new(&mut self, attr: Attribute) -> Result<(), Attribute>
Insert attr in the attribute set, but only if there is no existing attribute with the same
name.
Returns Err with attr if there is already an existing attribute with the same name.
pub fn remove(&mut self, name: impl AsRef<str>) -> Option<Attribute>
pub fn remove(&mut self, name: impl AsRef<str>) -> Option<Attribute>
Removes the attribute named name, if present.
pub fn entry(&mut self, key: Ident) -> AttributeSetEntry<'_>
pub fn entry(&mut self, key: Ident) -> AttributeSetEntry<'_>
Gets the given key’s corresponding entry in the set for in-place modfication
pub fn clear(&mut self)
pub fn clear(&mut self)
Clear all attributes from the set
Trait Implementations§
§impl Arbitrary for AttributeSet
Available on crate feature arbitrary only.
impl Arbitrary for AttributeSet
arbitrary only.§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.§type Strategy = BoxedStrategy<AttributeSet>
type Strategy = BoxedStrategy<AttributeSet>
Strategy used to generate values of type Self.§fn arbitrary_with(
_args: <AttributeSet as Arbitrary>::Parameters,
) -> <AttributeSet as Arbitrary>::Strategy
fn arbitrary_with( _args: <AttributeSet as Arbitrary>::Parameters, ) -> <AttributeSet as Arbitrary>::Strategy
§impl Clone for AttributeSet
impl Clone for AttributeSet
§fn clone(&self) -> AttributeSet
fn clone(&self) -> AttributeSet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for AttributeSet
impl Debug for AttributeSet
§impl Default for AttributeSet
impl Default for AttributeSet
§fn default() -> AttributeSet
fn default() -> AttributeSet
§impl Deserializable for AttributeSet
impl Deserializable for AttributeSet
§fn read_from<R>(source: &mut R) -> Result<AttributeSet, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<AttributeSet, DeserializationError>where
R: ByteReader,
source, attempts to deserialize these bytes
into Self, and returns the result. Read more§fn min_serialized_size() -> usize
fn min_serialized_size() -> usize
§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
§fn read_from_bytes_with_budget(
bytes: &[u8],
budget: usize,
) -> Result<Self, DeserializationError>
fn read_from_bytes_with_budget( bytes: &[u8], budget: usize, ) -> Result<Self, DeserializationError>
Self from bytes with a byte budget limit. Read more§impl<'de> Deserialize<'de> for AttributeSet
impl<'de> Deserialize<'de> for AttributeSet
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AttributeSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AttributeSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Extend<Attribute> for AttributeSet
impl Extend<Attribute> for AttributeSet
§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Attribute>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Attribute>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)§impl FromIterator<Attribute> for AttributeSet
impl FromIterator<Attribute> for AttributeSet
§fn from_iter<T>(iter: T) -> AttributeSetwhere
T: IntoIterator<Item = Attribute>,
fn from_iter<T>(iter: T) -> AttributeSetwhere
T: IntoIterator<Item = Attribute>,
§impl PartialEq for AttributeSet
impl PartialEq for AttributeSet
§impl Serializable for AttributeSet
impl Serializable for AttributeSet
§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
self into bytes and writes these bytes into the target.§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
§impl Serialize for AttributeSet
impl Serialize for AttributeSet
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for AttributeSet
impl StructuralPartialEq for AttributeSet
Auto Trait Implementations§
impl Freeze for AttributeSet
impl RefUnwindSafe for AttributeSet
impl Send for AttributeSet
impl Sync for AttributeSet
impl Unpin for AttributeSet
impl UnsafeUnpin for AttributeSet
impl UnwindSafe for AttributeSet
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more