pub struct SingleNameEventProducer { /* private fields */ }
Expand description
An event producer for an event containing only one name. It is slightly optimized, but
otherwise functionally equivalent to the StaticVecEventProducer
with an array of one
element.
Implementations§
Source§impl SingleNameEventProducer
impl SingleNameEventProducer
Sourcepub fn deleted() -> Self
pub fn deleted() -> Self
Constructs a new SingleNameEventProducer
that will produce an event for one name of
type WatchEvent::Deleted
. Deleted refers to the directory the watcher itself is on, and
therefore statically refers to itself as “.”.
Sourcepub fn added(name: &str) -> Self
pub fn added(name: &str) -> Self
Constructs a new SingleNameEventProducer
that will produce an event for one name of
type WatchEvent::Added
.
Sourcepub fn removed(name: &str) -> Self
pub fn removed(name: &str) -> Self
Constructs a new SingleNameEventProducer
that will produce an event for one name of
type WatchEvent::Removed
.
Sourcepub fn existing(name: &str) -> Self
pub fn existing(name: &str) -> Self
Constructs a new SingleNameEventProducer
that will produce an event for one name of
type WatchEvent::Existing
.
Sourcepub fn idle() -> Self
pub fn idle() -> Self
Constructs a new SingleNameEventProducer
that will produce an WatchEvent::Idle
event.
Trait Implementations§
Source§impl EventProducer for SingleNameEventProducer
impl EventProducer for SingleNameEventProducer
Source§fn mask(&self) -> WatchMask
fn mask(&self) -> WatchMask
fidl_fuchsia_io::WatchMask::*
constants. There might be only one bit set and it should
correspond to the event returned by the Self::event()
method. It is a duplication, but it
helps the callers that need both masks and event IDs.Source§fn event(&self) -> WatchEvent
fn event(&self) -> WatchEvent
fidl_fuchsia_io::WatchEvent::*
constants. Must match what Self::mask()
, returns, see
there for details.Source§fn prepare_for_next_buffer(&mut self) -> bool
fn prepare_for_next_buffer(&mut self) -> bool
true
if it can. This method
does not actually need to construct the buffer just yet, as an optimization if it will not
be needed.