Struct libuv::handles::fs_poll::FsPollHandle
source · pub struct FsPollHandle { /* private fields */ }
Expand description
FS Poll handles allow the user to monitor a given path for changes. Unlike FsEventHandle, fs poll handles use stat to detect when a file has changed so they can work on file systems where fs event handles can’t.
Implementations§
source§impl FsPollHandle
impl FsPollHandle
sourcepub fn new(loop: &Loop) -> Result<FsPollHandle>
pub fn new(loop: &Loop) -> Result<FsPollHandle>
Create and initialize a new fs poll handle
sourcepub fn start<CB: Into<FsPollCB<'static>>>(
&mut self,
path: &str,
interval: u32,
cb: CB
) -> Result<(), Box<dyn Error>>
pub fn start<CB: Into<FsPollCB<'static>>>( &mut self, path: &str, interval: u32, cb: CB ) -> Result<(), Box<dyn Error>>
Check the file at path for changes every interval milliseconds.
Note: For maximum portability, use multi-second intervals. Sub-second intervals will not detect all changes on many file systems.
Trait Implementations§
source§impl Clone for FsPollHandle
impl Clone for FsPollHandle
source§fn clone(&self) -> FsPollHandle
fn clone(&self) -> FsPollHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl From<FsPollHandle> for Handle
impl From<FsPollHandle> for Handle
source§fn from(fs_poll: FsPollHandle) -> Handle
fn from(fs_poll: FsPollHandle) -> Handle
Converts to this type from the input type.
source§impl HandleTrait for FsPollHandle
impl HandleTrait for FsPollHandle
source§fn is_active(&self) -> bool
fn is_active(&self) -> bool
Returns non-zero if the handle is active, zero if it’s inactive. What “active” means
depends on the type of handle: Read more
source§fn is_closing(&self) -> bool
fn is_closing(&self) -> bool
Returns non-zero if the handle is closing or closed, zero otherwise. Read more
source§fn close<CB: Into<CloseCB<'static>>>(&mut self, cb: CB)
fn close<CB: Into<CloseCB<'static>>>(&mut self, cb: CB)
Request handle to be closed. close_cb will be called asynchronously after this call. This
MUST be called on each handle before memory is released. Moreover, the memory can only be
released in close_cb or after it has returned. Read more
source§fn ref(&mut self)
fn ref(&mut self)
Reference the given handle. References are idempotent, that is, if a handle is already
referenced calling this function again will have no effect.
source§fn unref(&mut self)
fn unref(&mut self)
Un-reference the given handle. References are idempotent, that is, if a handle is not
referenced calling this function again will have no effect.
source§fn send_buffer_size(&mut self, value: i32) -> Result<i32>
fn send_buffer_size(&mut self, value: i32) -> Result<i32>
Gets or sets the size of the send buffer that the operating system uses for the socket. Read more
source§fn recv_buffer_size(&mut self, value: i32) -> Result<i32>
fn recv_buffer_size(&mut self, value: i32) -> Result<i32>
Gets or sets the size of the receive buffer that the operating system uses for the socket. Read more
source§fn get_fileno(&self) -> Result<OsFile>
fn get_fileno(&self) -> Result<OsFile>
Gets the platform dependent file descriptor equivalent. Read more
source§fn get_type(&self) -> HandleType
fn get_type(&self) -> HandleType
Returns the type of the handle.
source§impl TryFrom<Handle> for FsPollHandle
impl TryFrom<Handle> for FsPollHandle
impl Copy for FsPollHandle
Auto Trait Implementations§
impl RefUnwindSafe for FsPollHandle
impl !Send for FsPollHandle
impl !Sync for FsPollHandle
impl Unpin for FsPollHandle
impl UnwindSafe for FsPollHandle
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