pub struct Global {
pub name: StrId,
pub ty: ValType,
pub mutable: bool,
pub init: Option<ConstId>,
}Expand description
A module-level variable.
§Examples
use bytecode_lang::{ConstId, Global, StrId, ValType};
let counter = Global { name: StrId(0), ty: ValType::I64, mutable: true, init: Some(ConstId(0)) };
assert!(counter.mutable);Fields§
§name: StrIdThe global’s name.
ty: ValTypeThe global’s type.
mutable: boolWhether Inst::SetGlobal may write it.
init: Option<ConstId>The initial value; None means the type’s default (zero, false,
U+0000, or nil).
Trait Implementations§
impl Copy for Global
impl Eq for Global
Source§impl Ord for Global
impl Ord for Global
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Global
impl PartialOrd for Global
impl StructuralPartialEq for Global
Auto Trait Implementations§
impl Freeze for Global
impl RefUnwindSafe for Global
impl Send for Global
impl Sync for Global
impl Unpin for Global
impl UnsafeUnpin for Global
impl UnwindSafe for Global
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