pub struct CoreBasic {
pub type_path: String,
}Fields§
§type_path: StringImplementations§
Source§impl CoreBasic
impl CoreBasic
Sourcepub fn parse(type_path: &str) -> CainomeResult<Self>
pub fn parse(type_path: &str) -> CainomeResult<Self>
Sourcepub fn type_name(&self) -> String
pub fn type_name(&self) -> String
Returns the name of the core basic type.
The type name is the last part of the type path, to remove any module name. The type name is also removing any generic parameters, if any.
§Example
use cainome_parser::tokens::CoreBasic;
let core_basic = CoreBasic::parse("core::felt252").unwrap();
assert_eq!(core_basic.type_name(), "felt252");§Returns
Returns the name of the core basic type.
Trait Implementations§
impl StructuralPartialEq for CoreBasic
Auto Trait Implementations§
impl Freeze for CoreBasic
impl RefUnwindSafe for CoreBasic
impl Send for CoreBasic
impl Sync for CoreBasic
impl Unpin for CoreBasic
impl UnwindSafe for CoreBasic
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