pub struct OwnedMessageCounter { /* private fields */ }Expand description
Owns a zx::Counter to track pending messages that prevent the container from suspending.
This struct ensures that the counter is reset to 0 when the last strong reference is dropped, effectively releasing any wake lock held by this counter.
Implementations§
Source§impl OwnedMessageCounter
impl OwnedMessageCounter
pub fn new(name: &str, counter: Option<Counter>) -> OwnedMessageCounterHandle
Sourcepub fn mark_handled(&self)
pub fn mark_handled(&self)
Decrements the counter, signaling that a pending message or operation has been handled.
This should be called when the work associated with a previous mark_pending call is
complete.
Sourcepub fn mark_pending(&self)
pub fn mark_pending(&self)
Increments the counter, signaling that a new message or operation is pending.
This prevents the system from suspending until a corresponding mark_handled call is made.
Creates a SharedMessageCounter from this OwnedMessageCounter.
new_pending_message - if a new pending message should be added
Trait Implementations§
Source§impl Display for OwnedMessageCounter
impl Display for OwnedMessageCounter
Auto Trait Implementations§
impl Freeze for OwnedMessageCounter
impl RefUnwindSafe for OwnedMessageCounter
impl Send for OwnedMessageCounter
impl Sync for OwnedMessageCounter
impl Unpin for OwnedMessageCounter
impl UnwindSafe for OwnedMessageCounter
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.