pub struct RustExpr(/* private fields */);Expand description
Rust expression syntax stored as static metadata.
Implementations§
Source§impl RustExpr
impl RustExpr
Sourcepub fn new(value: &'static str) -> Result<Self, RustSyntaxError>
pub fn new(value: &'static str) -> Result<Self, RustSyntaxError>
Validates Rust expression syntax stored as static metadata.
§Errors
Returns RustSyntaxError when value is not valid Rust expression
syntax.
Sourcepub const fn from_macro_tokens_unchecked(value: &'static str) -> Self
pub const fn from_macro_tokens_unchecked(value: &'static str) -> Self
Stores Rust expression syntax emitted by a trusted macro expansion.
Sourcepub fn parse(self) -> Result<Expr, RustSyntaxError>
pub fn parse(self) -> Result<Expr, RustSyntaxError>
Parses the stored Rust expression syntax.
§Errors
Returns RustSyntaxError when the stored string is not valid Rust
expression syntax.
Trait Implementations§
impl Copy for RustExpr
impl Eq for RustExpr
impl StructuralPartialEq for RustExpr
Auto Trait Implementations§
impl Freeze for RustExpr
impl RefUnwindSafe for RustExpr
impl Send for RustExpr
impl Sync for RustExpr
impl Unpin for RustExpr
impl UnsafeUnpin for RustExpr
impl UnwindSafe for RustExpr
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