pub struct Limit { /* private fields */ }Expand description
Limits classify the size range of resizeable storage associated with memory types and table types.
See https://webassembly.github.io/spec/core/syntax/types.html#limits
§Examples
§New
use wasm_ast::Limit;
let max = Some(2);
let min = 0;
let limit = Limit::new(min, max);
assert_eq!(limit.min(), min);
assert_eq!(limit.max(), max);§Unbounded
use wasm_ast::Limit;
assert_eq!(Limit::unbounded(2), Limit::new(2, None));/// ## Unbounded
use wasm_ast::Limit;
assert_eq!(Limit::bounded(2, 5), Limit::new(2, Some(5)));Implementations§
Trait Implementations§
Source§impl From<Limit> for MemoryType
impl From<Limit> for MemoryType
impl Copy for Limit
impl Eq for Limit
impl StructuralPartialEq for Limit
Auto Trait Implementations§
impl Freeze for Limit
impl RefUnwindSafe for Limit
impl Send for Limit
impl Sync for Limit
impl Unpin for Limit
impl UnwindSafe for Limit
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