Trait eos_rs::api::overlay::CreatableWithLease
source · pub trait CreatableWithLease<const N: u32>where
Self: Sized,{
// Required method
fn lease(&self) -> &OverlayLoadLease<N>;
// Provided methods
fn new(lease: OverlayLoadLease<N>) -> Self { ... }
fn new_checked() -> Self { ... }
unsafe fn new_unchecked() -> Self { ... }
}
Expand description
Trait for all structs that require a lease to be created (but nothing else).
Required Methods§
sourcefn lease(&self) -> &OverlayLoadLease<N>
fn lease(&self) -> &OverlayLoadLease<N>
Returns a reference to the overlay lease.
Provided Methods§
sourcefn new(lease: OverlayLoadLease<N>) -> Self
fn new(lease: OverlayLoadLease<N>) -> Self
Create a new instance by providing a lease.
Important
Overlay N must not be unloaded during the lifetime of the returned object.
sourcefn new_checked() -> Self
fn new_checked() -> Self
Create a new instance by checking if the overlay is loaded and acquiring a lease on it. This will panic if the overlay is not loaded.
Important
Overlay N must not be unloaded during the lifetime of the returned object.
sourceunsafe fn new_unchecked() -> Self
unsafe fn new_unchecked() -> Self
Create a new lease.
Safety
This function is unsafe because it does not check if the overlay is loaded. You need to make sure that the overlay is loaded before calling this function, and additionally ensure that during the lifetime of this object the overlay is not unloaded.