pub enum Attribute {
KeyPair {
key: Identifier,
value: Literal,
range: TextRange,
},
List {
key: Identifier,
values: Vec<Literal>,
range: TextRange,
},
}
Expand description
Defines an attribute (i.e., compiler directive).
Variants§
Implementations§
source§impl Attribute
impl Attribute
sourcepub fn keypair(
key: impl Into<Identifier>,
value: impl Into<Literal>,
range: impl Into<TextRange>,
) -> Self
pub fn keypair( key: impl Into<Identifier>, value: impl Into<Literal>, range: impl Into<TextRange>, ) -> Self
Constructor for the attribute that initializes it as a key/pair value.
§Arguments
key
: The given key, as a BraneScriptIdentifier
.value
: The given value, as a BraneScriptLiteral
.range
: TheTextRange
linking this attribute to the source text.
§Returns
A new Attribute.
sourcepub fn list(
key: impl Into<Identifier>,
values: impl Into<Vec<Literal>>,
range: impl Into<TextRange>,
) -> Self
pub fn list( key: impl Into<Identifier>, values: impl Into<Vec<Literal>>, range: impl Into<TextRange>, ) -> Self
Constructor for the attribute that initializes it as a list of values.
§Arguments
key
: The given key, as a BraneScriptIdentifier
.values
: The given values, as a list of BraneScriptLiteral
s.range
: TheTextRange
linking this attribute to the source text.
§Returns
A new Attribute.
Trait Implementations§
source§impl EnumDebug for Attribute
impl EnumDebug for Attribute
source§fn type_name() -> &'static str
fn type_name() -> &'static str
Returns the static name of the type used for EnumDebug-printing. Read more
source§fn variant_names() -> &'static [&'static str]
fn variant_names() -> &'static [&'static str]
Returns all variants in the trait as a list of names. Read more
source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Returns the static name of the variant. Read more
source§fn variant(&self) -> EnumDebugFormatter<'_, Self>
fn variant(&self) -> EnumDebugFormatter<'_, Self>
Returns a formatter for this enum that writes its variant name. Read more
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request