pub struct Generic<F: AsRawFd, E = Error> {
pub file: F,
pub interest: Interest,
pub mode: Mode,
/* private fields */
}
Expand description
A generic event source wrapping a FD-backed type
Fields§
§file: F
The wrapped FD-backed type
interest: Interest
The programmed interest
mode: Mode
The programmed mode
Implementations§
source§impl<F: AsRawFd> Generic<F, Error>
impl<F: AsRawFd> Generic<F, Error>
sourcepub fn new(file: F, interest: Interest, mode: Mode) -> Generic<F, Error>
pub fn new(file: F, interest: Interest, mode: Mode) -> Generic<F, Error>
Wrap a FD-backed type into a Generic
event source that uses
std::io::Error
as its error type.
sourcepub fn new_with_error<E>(
file: F,
interest: Interest,
mode: Mode
) -> Generic<F, E>
pub fn new_with_error<E>( file: F, interest: Interest, mode: Mode ) -> Generic<F, E>
Wrap a FD-backed type into a Generic
event source using an arbitrary error type.
Trait Implementations§
source§impl<F, E> EventSource for Generic<F, E>
impl<F, E> EventSource for Generic<F, E>
§type Ret = Result<PostAction, E>
type Ret = Result<PostAction, E>
The return type of the user callback Read more
§type Error = E
type Error = E
The error type returned from
process_events()
(not the user callback!).source§fn process_events<C>(
&mut self,
readiness: Readiness,
token: Token,
callback: C
) -> Result<PostAction, Self::Error>
fn process_events<C>( &mut self, readiness: Readiness, token: Token, callback: C ) -> Result<PostAction, Self::Error>
Process any relevant events Read more
source§fn register(
&mut self,
poll: &mut Poll,
token_factory: &mut TokenFactory
) -> Result<()>
fn register( &mut self, poll: &mut Poll, token_factory: &mut TokenFactory ) -> Result<()>
Register yourself to this poll instance Read more
source§fn reregister(
&mut self,
poll: &mut Poll,
token_factory: &mut TokenFactory
) -> Result<()>
fn reregister( &mut self, poll: &mut Poll, token_factory: &mut TokenFactory ) -> Result<()>
Re-register your file descriptors Read more
source§fn unregister(&mut self, poll: &mut Poll) -> Result<()>
fn unregister(&mut self, poll: &mut Poll) -> Result<()>
Unregister your file descriptors Read more
Auto Trait Implementations§
impl<F, E> RefUnwindSafe for Generic<F, E>where
E: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, E> Send for Generic<F, E>
impl<F, E> Sync for Generic<F, E>
impl<F, E> Unpin for Generic<F, E>
impl<F, E> UnwindSafe for Generic<F, E>where
E: UnwindSafe,
F: UnwindSafe,
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