pub struct Name { /* private fields */ }Expand description
Names are sequences of characters, which are scalar values as defined by Unicode (Section 2.4). Due to the limitations of the binary format, the length of a name is bounded by the length of its UTF-8 encoding.
See https://webassembly.github.io/spec/core/syntax/values.html#names
§Examples
use wasm_ast::Name;
let text = "test";
let name = Name::new(String::from(text));
assert_eq!(name, Name::from(text));
assert_eq!(name, Name::from(text.to_string()));
assert_eq!(name.as_bytes(), text.as_bytes());
assert_eq!(name.len(), text.len());
assert_eq!(name.is_empty(), false);Implementations§
Trait Implementations§
impl Eq for Name
impl StructuralPartialEq for Name
Auto Trait Implementations§
impl Freeze for Name
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnwindSafe for Name
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