Config

Struct Config 

Source
#[non_exhaustive]
pub struct Config<'a> { pub source: &'a OsStr, pub exclude: &'a [&'a OsStr], pub include: &'a [&'a OsStr], pub executable: &'a OsStr, pub links: bool, pub recursive: bool, }
Expand description

Configuration for a list.

Many options refernce the rsync command line options and syntax. See https://download.samba.org/pub/rsync/rsync.html for the reference documentation on those options.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§source: &'a OsStr

The source to list.

Example: rsync://example.com/path Example: me@example.com:/path

These are the same syntax as the rsync command line.

§exclude: &'a [&'a OsStr]

Patterns to exclude from the listing.

Example: www/*.gz

This corresponds to rsync’s –exclude flag.

§include: &'a [&'a OsStr]

Patterns not to exclude..

Example: www/*.tar.gz

This corresponds to rsync’s –include flag.

§executable: &'a OsStr

The rsync executable to use.

This will be looked for in $PATH if it does not contain any directory separators.

Default: rsync

§links: bool

If links should be reported. If false links will be reported as the file that they point to.

Note: The last modified time will always be that of the link, not that of the target.

Default: true

§recursive: bool

Recursively list the source.

Default: true

Implementations§

Source§

impl<'a> Config<'a>

Source

pub fn new(source: &'a (impl AsRef<OsStr> + ?Sized)) -> Self

Source

pub fn list(&self) -> impl Stream<Item = Result<Entry, Error>>

Trait Implementations§

Source§

impl<'a> Debug for Config<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Config<'a>

§

impl<'a> RefUnwindSafe for Config<'a>

§

impl<'a> Send for Config<'a>

§

impl<'a> Sync for Config<'a>

§

impl<'a> Unpin for Config<'a>

§

impl<'a> UnwindSafe for Config<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.