pub struct LeaseHelper { /* private fields */ }
Expand description
Helper for acquiring leases. Instantiate with LeaseControl::new(), and then acquire a lease with the lease() method. The lease() call will return only once the lease is satisfied.
A single LeaseHelper may be reused to create leases an arbitrary number of times.
Implementations§
Source§impl LeaseHelper
impl LeaseHelper
Sourcepub async fn new<'a>(
topology: &'a TopologyProxy,
name: &'a str,
lease_dependencies: Vec<LeaseDependency>,
) -> Result<Arc<Self>>
pub async fn new<'a>( topology: &'a TopologyProxy, name: &'a str, lease_dependencies: Vec<LeaseDependency>, ) -> Result<Arc<Self>>
Creates a new LeaseHelper. Returns an error upon failure to register the to-be-leased power element with Power Broker.
Auto Trait Implementations§
impl Freeze for LeaseHelper
impl !RefUnwindSafe for LeaseHelper
impl Send for LeaseHelper
impl Sync for LeaseHelper
impl Unpin for LeaseHelper
impl !UnwindSafe for LeaseHelper
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