pub struct RsyncSyntax;Expand description
Interprets the folder-transfer sorts as ordinary in-memory records.
Trait Implementations§
Source§impl Clone for RsyncSyntax
impl Clone for RsyncSyntax
impl Copy for RsyncSyntax
Source§impl Debug for RsyncSyntax
impl Debug for RsyncSyntax
Source§impl Default for RsyncSyntax
impl Default for RsyncSyntax
impl Eq for RsyncSyntax
Source§impl PartialEq for RsyncSyntax
impl PartialEq for RsyncSyntax
Source§impl RsyncEndpointAlg for RsyncSyntax
impl RsyncEndpointAlg for RsyncSyntax
Source§impl RsyncEndpointViewAlg for RsyncSyntax
impl RsyncEndpointViewAlg for RsyncSyntax
Source§fn endpoint_user<'a>(&self, endpoint: &'a Self::Endpoint) -> Option<&'a str>
fn endpoint_user<'a>(&self, endpoint: &'a Self::Endpoint) -> Option<&'a str>
Source§fn endpoint_host<'a>(&self, endpoint: &'a Self::Endpoint) -> Option<&'a str>
fn endpoint_host<'a>(&self, endpoint: &'a Self::Endpoint) -> Option<&'a str>
Source§fn endpoint_path<'a>(&self, endpoint: &'a Self::Endpoint) -> &'a str
fn endpoint_path<'a>(&self, endpoint: &'a Self::Endpoint) -> &'a str
Source§impl RsyncSorts for RsyncSyntax
impl RsyncSorts for RsyncSyntax
Source§type Endpoint = RsyncEndpoint
type Endpoint = RsyncEndpoint
Source§type Command = SyncCommand
type Command = SyncCommand
Source§type Observation = SyncObservation
type Observation = SyncObservation
Source§type Change = PlannedChange
type Change = PlannedChange
impl StructuralPartialEq for RsyncSyntax
Source§impl SyncChangeAlg for RsyncSyntax
impl SyncChangeAlg for RsyncSyntax
Source§fn sync_change(
&self,
path: impl Into<String>,
kind: ChangeKind,
size: Option<u64>,
) -> Self::Change
fn sync_change( &self, path: impl Into<String>, kind: ChangeKind, size: Option<u64>, ) -> Self::Change
Source§impl SyncCommandAlg for RsyncSyntax
impl SyncCommandAlg for RsyncSyntax
Source§fn sync_command(
&self,
program: impl Into<String>,
arguments: impl IntoIterator<Item = String>,
) -> Self::Command
fn sync_command( &self, program: impl Into<String>, arguments: impl IntoIterator<Item = String>, ) -> Self::Command
Source§impl SyncCommandViewAlg for RsyncSyntax
impl SyncCommandViewAlg for RsyncSyntax
Source§impl SyncObservationAlg for RsyncSyntax
impl SyncObservationAlg for RsyncSyntax
Source§fn observed_change(&self, change: Self::Change) -> Self::Observation
fn observed_change(&self, change: Self::Change) -> Self::Observation
Source§fn observed_progress(&self, transferred: u64, percent: u16) -> Self::Observation
fn observed_progress(&self, transferred: u64, percent: u16) -> Self::Observation
Source§fn observed_nothing(&self) -> Self::Observation
fn observed_nothing(&self) -> Self::Observation
Source§impl SyncObservationViewAlg for RsyncSyntax
impl SyncObservationViewAlg for RsyncSyntax
Source§fn observation_change<'a>(
&self,
observation: &'a Self::Observation,
) -> Option<&'a Self::Change>
fn observation_change<'a>( &self, observation: &'a Self::Observation, ) -> Option<&'a Self::Change>
Source§fn observation_progress(
&self,
observation: &Self::Observation,
) -> Option<(u64, u16)>
fn observation_progress( &self, observation: &Self::Observation, ) -> Option<(u64, u16)>
Auto Trait Implementations§
impl Freeze for RsyncSyntax
impl RefUnwindSafe for RsyncSyntax
impl Send for RsyncSyntax
impl Sync for RsyncSyntax
impl Unpin for RsyncSyntax
impl UnsafeUnpin for RsyncSyntax
impl UnwindSafe for RsyncSyntax
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<This> GaugeLaws<This> for This
impl<This> GaugeLaws<This> for This
Source§fn gauge_laws(&self) -> Result<(), Error>
fn gauge_laws(&self) -> Result<(), Error>
Checks that a gauge states a share without claiming more resolution than it has.
The laws checked are:
- a gauge occupies its stated width whatever share it states;
- no share is stated as filled before it is reached, and none is stated twice;
- nothing stated is nothing filled, and everything stated fills the whole track;
- the stated text occupies exactly one cell per counted cell.
§Errors
Returns the first violated law.
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"]);Source§impl<This> RsyncEndpointExt<This> for Thiswhere
This: RsyncEndpointAlg + RsyncEndpointViewAlg,
impl<This> RsyncEndpointExt<This> for Thiswhere
This: RsyncEndpointAlg + RsyncEndpointViewAlg,
Source§fn read_endpoint(&self, input: &str) -> <This as RsyncSorts>::Endpoint
fn read_endpoint(&self, input: &str) -> <This as RsyncSorts>::Endpoint
Reads one endpoint from the text somebody submitted.
Three shapes name a path on another machine: a daemon URL, and a machine and a path separated by a colon with nothing path-like before it. A text naming any other scheme names a resource somewhere else, and a text naming neither names a path here.
Source§fn read_transfer(
&self,
line: &str,
) -> Option<(<This as RsyncSorts>::Endpoint, <This as RsyncSorts>::Endpoint)>
fn read_transfer( &self, line: &str, ) -> Option<(<This as RsyncSorts>::Endpoint, <This as RsyncSorts>::Endpoint)>
Reads one submitted line as the two ends of a transfer, when it names two.
A transfer is written the way it is run: what comes from, then what it comes to. Anything naming how rather than what — the program itself, and the arguments given to it — is already stated by the transfer, so a whole command can be submitted and still be read.
Source§fn endpoint_remote(&self, endpoint: &<This as RsyncSorts>::Endpoint) -> bool
fn endpoint_remote(&self, endpoint: &<This as RsyncSorts>::Endpoint) -> bool
Observes whether the path rests on another machine.
Source§fn endpoint_text(&self, endpoint: &<This as RsyncSorts>::Endpoint) -> String
fn endpoint_text(&self, endpoint: &<This as RsyncSorts>::Endpoint) -> String
States the endpoint the way the transfer program is given it.
Source§fn endpoint_name<'a>(
&self,
endpoint: &'a <This as RsyncSorts>::Endpoint,
) -> &'a str
fn endpoint_name<'a>( &self, endpoint: &'a <This as RsyncSorts>::Endpoint, ) -> &'a str
Names what the path ends with, without the path that leads to it.
Source§impl<This> SyncCommandExt<This> for This
impl<This> SyncCommandExt<This> for This
Source§fn transfer_command(
&self,
source: &<This as RsyncSorts>::Endpoint,
destination: &<This as RsyncSorts>::Endpoint,
mode: SyncMode,
) -> <This as RsyncSorts>::Command
fn transfer_command( &self, source: &<This as RsyncSorts>::Endpoint, destination: &<This as RsyncSorts>::Endpoint, mode: SyncMode, ) -> <This as RsyncSorts>::Command
States the command transferring one endpoint into another.
What is transferred may be one file or a whole folder, and each end is stated exactly as it was written. A source ending with a separator names the contents of a folder; one without names the path itself, which comes to rest inside the destination. Both are wanted, so neither is invented here.
Source§fn command_rehearses(&self, command: &<This as RsyncSorts>::Command) -> bool
fn command_rehearses(&self, command: &<This as RsyncSorts>::Command) -> bool
Observes whether the command states what it would do instead of doing it.
Source§fn command_mirrors(&self, command: &<This as RsyncSorts>::Command) -> bool
fn command_mirrors(&self, command: &<This as RsyncSorts>::Command) -> bool
Observes whether the command removes what the source no longer holds.
Source§impl<This> SyncReadExt<This> for Thiswhere
This: SyncChangeAlg + SyncObservationAlg,
impl<This> SyncReadExt<This> for Thiswhere
This: SyncChangeAlg + SyncObservationAlg,
Source§fn read_sync_line(&self, line: &str) -> <This as RsyncSorts>::Observation
fn read_sync_line(&self, line: &str) -> <This as RsyncSorts>::Observation
Reads one line the transfer program wrote as what it states.
A change is stated in three fields: the flags naming what happens, the byte count, and the path. Anything else on the stream is progress, or is nothing this specification reads.
Source§fn read_sync_change(&self, line: &str) -> Option<<This as RsyncSorts>::Change>
fn read_sync_change(&self, line: &str) -> Option<<This as RsyncSorts>::Change>
Reads one itemized line as the change it denotes, and states nothing for a line naming only that a folder was opened on the way to what is inside it.