pub struct GlobalSpec<'a> { /* private fields */ }
Expand description
A WebAssembly global along with its export specification.
The lifetime parameter exists to support zero-copy deserialization for the &str
fields at the
leaves of the structure. For a variant with owned types at the leaves, see
OwnedGlobalSpec
.
Implementations§
Source§impl<'a> GlobalSpec<'a>
impl<'a> GlobalSpec<'a>
pub fn new(global: Global<'a>, export_names: Vec<&'a str>) -> Self
Sourcepub fn new_def(init_val: i64, export_names: Vec<&'a str>) -> Self
pub fn new_def(init_val: i64, export_names: Vec<&'a str>) -> Self
Create a new global definition with an initial value and export names.
Sourcepub fn new_import(
module: &'a str,
field: &'a str,
export_names: Vec<&'a str>,
) -> Self
pub fn new_import( module: &'a str, field: &'a str, export_names: Vec<&'a str>, ) -> Self
Create a new global import definition with a module and field name, and export names.
pub fn global(&self) -> &Global<'_>
pub fn export_names(&self) -> &[&str]
pub fn is_internal(&self) -> bool
Trait Implementations§
Source§impl<'a> Clone for GlobalSpec<'a>
impl<'a> Clone for GlobalSpec<'a>
Source§fn clone(&self) -> GlobalSpec<'a>
fn clone(&self) -> GlobalSpec<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for GlobalSpec<'a>
impl<'a> Debug for GlobalSpec<'a>
Source§impl<'de: 'a, 'a> Deserialize<'de> for GlobalSpec<'a>
impl<'de: 'a, 'a> Deserialize<'de> for GlobalSpec<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> PartialEq for GlobalSpec<'a>
impl<'a> PartialEq for GlobalSpec<'a>
Source§impl<'a> Serialize for GlobalSpec<'a>
impl<'a> Serialize for GlobalSpec<'a>
impl<'a> StructuralPartialEq for GlobalSpec<'a>
Auto Trait Implementations§
impl<'a> Freeze for GlobalSpec<'a>
impl<'a> RefUnwindSafe for GlobalSpec<'a>
impl<'a> Send for GlobalSpec<'a>
impl<'a> Sync for GlobalSpec<'a>
impl<'a> Unpin for GlobalSpec<'a>
impl<'a> UnwindSafe for GlobalSpec<'a>
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