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