Struct fswatch_sys::FswSessionBuilder
[−]
[src]
pub struct FswSessionBuilder { /* fields omitted */ }
A builder for FswSession
.
This struct saves all the options passed to it by the builder methods, which means it is safe
to call the builder methods multiple times, as nothing will be passed to the C API until
build
is called.
Methods
impl FswSessionBuilder
[src]
fn empty() -> Self
Creates an empty builder, not requiring paths
to be set.
This is mainly useful when constructing an FswSession
for use as an iterator.
fn new<P>(paths: Vec<P>) -> Self where P: AsRef<Path>
Make a new builder with the required variables.
fn build(self) -> Result<FswSession, FswError>
Build the FswSession
, applying all specified options before passing ownership to the caller.
If any errors occur while applying options, they are propagated up.
fn build_callback<F>(self, callback: F) -> Result<FswSession, FswError> where F: Fn(Vec<FswEvent>) + 'static
Build the FswSession
with a callback, applying all specified options before passing
ownership to the caller.
If any errors occur while applying options, they are propagated up.
fn add_path<P>(self, path: P) -> Self where P: AsRef<Path>
Add a path to monitor for this session.
fn monitor(self, monitor: FswMonitorType) -> Self
Set the type of monitor for this session.
fn property(self, name: &str, value: &str) -> Self
Add a custom property to this session. Properties with the same name will keep the last value specified.
fn overflow(self, overflow: Option<bool>) -> Self
Set the overflow property for this session.
fn latency(self, latency: Option<c_double>) -> Self
Set the latency for this session, for monitors using this property.
fn recursive(self, recursive: Option<bool>) -> Self
Set whether this session should be recursive.
fn directory_only(self, directory_only: Option<bool>) -> Self
Set whether this session is directory only.
fn follow_symlinks(self, follow_symlinks: Option<bool>) -> Self
Set whether this session should follow symlinks.
fn add_event_filter(self, filter_type: FswEventFlag) -> Self
Add an event flag filter for this session.
fn add_filter(self, filter: FswMonitorFilter) -> Self
Add a filter for this session.