pub(crate) enum Report<'a> {
Message(&'a OsStr),
PathChange {
change_kind: ChangeKind,
path_kind: PathKind,
path: &'a Path,
},
Empty,
}
Expand description
Change information reported by rsync
.
Variants§
Message(&'a OsStr)
rsync
message string.
PathChange
Changes have been made to a local path.
Fields
§
change_kind: ChangeKind
Kind of change that is being made.
Empty
rsync
did not report any changes.
Implementations§
Source§impl<'a> Report<'a>
impl<'a> Report<'a>
Sourcepub(crate) fn parser(line: &'a [u8]) -> ModalResult<Self>
pub(crate) fn parser(line: &'a [u8]) -> ModalResult<Self>
Parse a Self
from one line of rsync --itemize-changes
.
Callers should be careful to remove trailing newlines from rsync
output
as this function will not remove them.
For accepted inputs, see the
--itemize-changes
section in man 1 rsync
.
§Errors
Throws an error if input
is of an unknown format
Sourcepub(crate) fn file_content_updated(&self) -> Result<Option<&Path>>
pub(crate) fn file_content_updated(&self) -> Result<Option<&Path>>
Check if file content was changed in such a way that it should be extracted again.
Returns Ok(Some(path))
, where path
points to the file if there were changes.
Otherwise Ok(None)
.
This does not consider the following to be “relevant” changes:
- Directory creation or other “local changes” as defined by rsync.
- Sending to remote. This should not be possible when using this tool.
- Attribute changes.
- File deletion.
§Errors
Returns an error if self
:
- Holds a non-deletion message from rsync.
- Reports a change to a non-file object. See
PathKind
.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Report<'a>
impl<'a> RefUnwindSafe for Report<'a>
impl<'a> Send for Report<'a>
impl<'a> Sync for Report<'a>
impl<'a> Unpin for Report<'a>
impl<'a> UnwindSafe for Report<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more