pub struct StatusListener { /* private fields */ }Expand description
An object that listens for status changes.
~Deprecated: In new code consider using crate::host::descriptor::listener::StateEventSource,
which supports Rust closures or directly takes crate::cshadow::StatusListener.
Implementations§
Source§impl StatusListener
 
impl StatusListener
Sourcepub unsafe fn clone_from_c(host: &Host, ptr: *mut StatusListener) -> Self
 
pub unsafe fn clone_from_c(host: &Host, ptr: *mut StatusListener) -> Self
Create an owned reference from ptr. Reference count is incremented on
creation, and decremented on Drop.
§Safety
ptr must be safely dereferenceable.
Sourcepub fn new(host: &Host, notify: impl Fn(&Host) + Send + Sync + 'static) -> Self
 
pub fn new(host: &Host, notify: impl Fn(&Host) + Send + Sync + 'static) -> Self
Create a StatusListener with the given notification function.
Sourcepub fn handle_status_change(
    &self,
    host: &Host,
    current: FileState,
    transitions: FileState,
)
 
pub fn handle_status_change( &self, host: &Host, current: FileState, transitions: FileState, )
Called when a transition (bit flip) occurred on at least one of its status bits. (This function should only be called by status owners, i.e., the descriptor or futex base classes.) If this listener is monitoring (via setMonitorStatus) any of the status bits that just transitioned, then this function will trigger a notification via the callback supplied to the new func.
Sourcepub fn set_monitor_status(
    &self,
    host: &Host,
    status: FileState,
    filter: StatusListenerFilter,
)
 
pub fn set_monitor_status( &self, host: &Host, status: FileState, filter: StatusListenerFilter, )
Set the status bits that we should monitor for transitions (flips), and a filter that specifies which flips should cause the callback to be invoked.
Trait Implementations§
Source§impl Debug for StatusListener
 
impl Debug for StatusListener
Source§impl Drop for StatusListener
 
impl Drop for StatusListener
Source§impl Ord for StatusListener
 
impl Ord for StatusListener
Source§impl PartialEq for StatusListener
 
impl PartialEq for StatusListener
Source§impl PartialOrd for StatusListener
 
impl PartialOrd for StatusListener
impl Eq for StatusListener
Auto Trait Implementations§
impl Freeze for StatusListener
impl RefUnwindSafe for StatusListener
impl Send for StatusListener
impl Sync for StatusListener
impl Unpin for StatusListener
impl UnwindSafe for StatusListener
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
Source§impl<Q, K> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
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>
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>
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 more