pub struct MeterSlot { /* private fields */ }Expand description
A meter slot with an auto-assigned ID.
Declare in your params struct with #[meter]:
ⓘ
#[derive(Params)]
pub struct MyParams {
#[meter]
pub meter_left: MeterSlot,
}id is pub so the #[derive(Params)] macro can construct a
MeterSlot { id: <auto-assigned> } directly without going through
a pub fn new(id) constructor that would let user code mint
arbitrary slots and break the auto-assignment contract.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MeterSlot
impl RefUnwindSafe for MeterSlot
impl Send for MeterSlot
impl Sync for MeterSlot
impl Unpin for MeterSlot
impl UnsafeUnpin for MeterSlot
impl UnwindSafe for MeterSlot
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