Struct fswatch::FswSession [] [src]

pub struct FswSession { /* fields omitted */ }

A session in fswatch, revolving around a handle.

Calling new creates a new handle, initiating a new session. Options can be set before calling start_monitor.

Methods

impl FswSession
[src]

Create a new session and handle, using the given monitor type.

Create a new session and handle, using the system default monitor type.

This is a convenience method for FswSession::new(FswMonitorType::SystemDefaultMonitorType).

Create a new empty FswSessionBuilder.

This is a convenience method for FswSessionBuilder::empty().

Create a new FswSessionBuilder with the given paths.

This is a convenience method for FswSessionBuilder::new(paths).

Add a path to watch for this session.

Add a custom property to this session.

Set whether to allow overflow for this session.

Set the callback for this session.

The callback will receive a Vec<FswEvent>, which is a copy of the events given by fswatch.

Safety

Calling this multiple times will cause this session to use the last callback specified, but due to the limited functions in the C API, the previous callbacks will never be freed from memory, causing a memory leak.

Set the latency for this session.

Set whether this session should be recursive.

Set whether this session should be directory only.

Set whether this session should follow symlinks.

Add an event filter for the given event flag.

Add a filter.

Start monitoring for this session.

Depending on the monitor you are using, this method may block.

Errors

This method will return an error if set_callback has not been successfully called or if add_path has not been successfully called at least once. To start the monitor without these checks, use start_monitor_unchecked.

Start monitoring for this session.

Depending on the monitor you are using, this method may block.

Safety

This function will cause an illegal memory access or another type of memory error, crashing the program, if it is called without a callback or without any paths. As far as I can tell, this is a problem in the C API of libfswatch.

Destroy this session, freeing it from memory and invalidating its handle.

This is called automatically when the session goes out of scope.

Trait Implementations

impl IntoIterator for FswSession
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl Drop for FswSession
[src]

A method called when the value goes out of scope. Read more