pub struct Line { /* private fields */ }Available on crate feature
line_token only.Expand description
Implementations§
Source§impl Line
impl Line
Sourcepub async fn status(&self) -> LineStatus
pub async fn status(&self) -> LineStatus
Retrieve the current status of the Line, i.e. whether it’s currently
free or not.
Unlike try_acquire_token, this method does not attempt to lock the
line if it’s free, and does not generate a Token. If the line is
busy, it returns a future the consumer can use to wait till the line
becomes free again.
Sourcepub async fn try_acquire_token<'l>(&'l self) -> AcquireOutcome<'l>
pub async fn try_acquire_token<'l>(&'l self) -> AcquireOutcome<'l>
Attempts to acquire a Token for this line.
The Token automatically releases the line upon leaving the current
scope and getting dropped.
If a Token has already been acquired for this line, a future to
await is returned instead. It resolves when the current token holder
has finished handling the current error and releases the line.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Line
impl !RefUnwindSafe for Line
impl !UnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnsafeUnpin for Line
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