Struct fswatch_sys::FswSessionBuilder
[−]
[src]
pub struct FswSessionBuilder { /* fields omitted */ }
A builder for FswSession
.
This builder requires that paths
and callback
be supplied in its constructor, as the program
may crash if a session is started without those fields.
Methods
impl FswSessionBuilder
[src]
fn empty() -> Self
Creates an empty builder, not requiring paths
and callback
being 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 propagted up.
fn build_callback<F>(self, callback: F) -> Result<FswSession, FswError> where F: Fn(Vec<FswCEvent>) + '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 propagted 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: FswCMonitorFilter) -> Self
Add a filter for this session.