pub enum Literal {
Null {
range: TextRange,
},
Boolean {
value: bool,
range: TextRange,
},
Integer {
value: i64,
range: TextRange,
},
Real {
value: f64,
range: TextRange,
},
String {
value: String,
range: TextRange,
},
Semver {
value: String,
range: TextRange,
},
Void {
range: TextRange,
},
}
Expand description
Defines a literal constant.
Variants§
Null
Defines the null literal.
Boolean
Defines a boolean literal.
Fields
Integer
Defines an integral literal.
Fields
Real
Defines a floating-point literal.
String
Defines a String literal.
Fields
Semver
Defines a SemVer literal.
Void
Defines a Void literal (no value).
Implementations§
source§impl Literal
impl Literal
sourcepub fn as_bool_ref(&self) -> &bool
pub fn as_bool_ref(&self) -> &bool
sourcepub fn as_bool_mut(&mut self) -> &mut bool
pub fn as_bool_mut(&mut self) -> &mut bool
sourcepub fn as_int_ref(&self) -> &i64
pub fn as_int_ref(&self) -> &i64
sourcepub fn as_int_mut(&mut self) -> &mut i64
pub fn as_int_mut(&mut self) -> &mut i64
sourcepub fn as_real_ref(&self) -> &f64
pub fn as_real_ref(&self) -> &f64
sourcepub fn as_real_mut(&mut self) -> &mut f64
pub fn as_real_mut(&mut self) -> &mut f64
sourcepub fn as_string_ref(&self) -> &str
pub fn as_string_ref(&self) -> &str
sourcepub fn as_string_mut(&mut self) -> &mut str
pub fn as_string_mut(&mut self) -> &mut str
sourcepub fn as_version(&self) -> Result<Version, ParseError>
pub fn as_version(&self) -> Result<Version, ParseError>
Trait Implementations§
source§impl EnumDebug for Literal
impl EnumDebug for Literal
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 Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
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