pub enum SyncProfile {
Show 13 variants
Copy,
Mirror,
MirrorKeeping,
MirrorWhole,
MirrorReadable,
SkipNewer,
CompareContent,
Resume,
Move,
LimitRate,
KeepMarks,
OneDisk,
SkipJunk,
}Expand description
Selects one commonly wanted way of transferring a path.
A transfer has a great many arguments and almost nobody wants an arbitrary combination of them: what people want is one of a handful of familiar jobs. Each of these names what it does — not what it is for — and states exactly the arguments that make it do that.
Variants§
Copy
Adds and replaces, and removes nothing.
Mirror
Makes the destination match the source exactly.
MirrorKeeping
Mirrors, keeping what it replaces and compressing what it sends.
MirrorWhole
Mirrors by sending whole files rather than comparing them piece by piece.
MirrorReadable
Mirrors, and makes everything readable where it lands.
SkipNewer
Replaces nothing that is newer at the destination.
CompareContent
Compares what files hold rather than when they changed.
Resume
Continues large files where an interrupted transfer left them.
Move
Moves, removing from the source whatever arrived safely.
LimitRate
Leaves room on the line for everything else.
KeepMarks
Keeps links, ownership, and every other mark a file carries.
OneDisk
Stays on the disk it started on.
SkipJunk
Leaves behind what no one meant to keep.
Implementations§
Source§impl SyncProfile
impl SyncProfile
Sourcepub const fn summary(self) -> &'static str
pub const fn summary(self) -> &'static str
States what the transfer does, and then what that is usually wanted for.
A reader chooses by what a way of transferring does, and confirms the choice by what it is good for, so both are stated and in that order.
Sourcepub const fn profile_arguments(self) -> &'static [&'static str]
pub const fn profile_arguments(self) -> &'static [&'static str]
States exactly the arguments that make the transfer this job and no other.
Trait Implementations§
Source§impl Clone for SyncProfile
impl Clone for SyncProfile
impl Copy for SyncProfile
Source§impl Debug for SyncProfile
impl Debug for SyncProfile
impl Eq for SyncProfile
Source§impl PartialEq for SyncProfile
impl PartialEq for SyncProfile
impl StructuralPartialEq for SyncProfile
Auto Trait Implementations§
impl Freeze for SyncProfile
impl RefUnwindSafe for SyncProfile
impl Send for SyncProfile
impl Sync for SyncProfile
impl Unpin for SyncProfile
impl UnsafeUnpin for SyncProfile
impl UnwindSafe for SyncProfile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 moreSource§impl<This> IntoExt<This> for This
impl<This> IntoExt<This> for This
Source§fn to<R>(self) -> Rwhere
This: Into<R>,
fn to<R>(self) -> Rwhere
This: Into<R>,
A version of Into::into function that can be used to explicitly specify the target
conversion type.
use alux_sdk::*;
// `Into` requires context to infer the type,
let _: i64 = Into::into(42_i8);
// The opposite `From` requires context to infer the type,
let _: i64 = From::from(42_i8);
// `.to()` can be used in the same way as a postfix function (the same as `.into()`),
let _: i64 = 42_i8.to();
// but also with the type specified explicitly.
let _ = 42_i8.to::<i64>();
// Especially useful to chain multiple conversions inline.
let _: i64 = 42_i8.to::<i16>().to::<i32>().into();Source§impl<This> IntoIteratorExt<This> for This
impl<This> IntoIteratorExt<This> for This
Source§fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
A variant of the try_collect and collect_vec combined function from the Itertools
library. The materialized value is a Vec inside a Result object.
Returns the first error without collecting later values.
use alux_sdk::*;
let values = [Ok::<_, &str>(1), Ok(2), Ok(3)]
.into_iter()
.try_collect_vec();
assert_eq!(values, Ok(vec![1, 2, 3]));Source§fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
Takes exactly n elements from the iterator.
Returns Some(Vec<T>) if the iterator yields exactly n elements,
otherwise returns None.
use alux_sdk::*;
let v = [1, 2, 3];
assert_eq!(v.iter().copied().collect_exact(3), Some(vec![1, 2, 3]));
assert_eq!(v.iter().copied().collect_exact(4), None);
assert_eq!(v.iter().copied().collect_exact(2), None);Source§fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
Efficiently splits an iterator of Result<(A, B), E> into two Vecs, short-circuiting on error.
Consumes the iterator, collecting all A elements into one vector and all B elements into another,
without first allocating an intermediate vector of tuples. Returns the tuple (Vec<A>, Vec<B>) on success,
or the first error encountered.
use alux_sdk::*;
let input = vec![Ok((1, "x")), Ok((2, "y"))];
let (xs, ys) = input.try_unzip::<_, _, ()>().unwrap();
assert_eq!(xs, vec![1, 2]);
assert_eq!(ys, vec!["x", "y"]);