pub struct State {Show 21 fields
pub on: Option<bool>,
pub given: String,
pub asked: i64,
pub send: Option<bool>,
pub folder: String,
pub account: String,
pub url: String,
pub confirmed: i64,
pub sealed: i64,
pub looked: i64,
pub last: i64,
pub tried: i64,
pub said: String,
pub left: BTreeMap<String, u64>,
pub own_entry: Option<(u64, i64)>,
pub mode: String,
pub place: String,
pub pushed: i64,
pub files: BTreeMap<String, Fetched>,
pub folders: BTreeMap<String, Looked>,
pub sent: BTreeMap<String, Sent>,
}Expand description
What the backup knows, kept privately beside the sharing’s memory
(remote.toml), never shared. on, given and asked are yours,
written only through State::choose; the rest is the backup’s.
Fields§
§on: Option<bool>Switched on or off here; unsaid, on.
given: StringThe folder’s place on the server, given by hand: a path in an account’s files (“Documents/Sioul”), or an address; “” to look by itself.
asked: i64When you asked to look again (Unix seconds).
send: Option<bool>This device’s own files sent there too, beside the sync app (send):
as switched here, else on wherever the backup is.
folder: StringThe sharing folder here it backs.
account: StringThe account whose server holds it, by its id, and the folder there (an address ending with “/”).
url: String§confirmed: i64Since when the server’s seal is found to be this folder’s (Unix seconds); 0: not confirmed.
sealed: i64When the server’s seal was last read and found the same (Unix seconds).
looked: i64When the folder was last looked for (Unix seconds).
last: i64When a pull last went through, and was last tried (Unix seconds).
tried: i64§said: StringWhy nothing is fetched, or the last pull failed, in a code (“not-found:murena.io”, “network:murena.io”); “” when all is well.
left: BTreeMap<String, u64>The other devices’ records on the server past what a pull brings
(LARGEST), longer there than here, by name, as the last look through
the folder found them: only the sync app brings them, and the pull
alone is not trusted meanwhile (pulls_well).
own_entry: Option<(u64, i64)>This device’s entry on the server (devices/<id>.device) as a pull
last listed it: its size, and when (Unix seconds). Of another size than
this device last sent, listed after that send, it is an older copy put
back there: looked at again by the next send, and sent over it (send).
mode: StringMIRROR when Sioul keeps the folder in step itself, no sync app: the
folder here is its own copy (mirror_of), the server’s is the one the
devices share; “” beside a sync app’s folder.
place: StringThe folder’s place in the account’s files, as given (“Documents/Sioul”): to say where.
pushed: i64When this device’s own files last went up (MIRROR, Unix seconds).
files: BTreeMap<String, Fetched>The server’s files as last fetched, or found here already, by their path in the folder.
folders: BTreeMap<String, Looked>The server’s folders as last looked through, by their path (“” the folder itself, “devices/”).
sent: BTreeMap<String, Sent>This device’s own files as they last went up (MIRROR), by their path in the folder.
Implementations§
Source§impl State
impl State
pub fn load(memory: &Path) -> State
fn write(&self, memory: &Path) -> Result<(), String>
Sourcefn save(&self, memory: &Path) -> Result<(), String>
fn save(&self, memory: &Path) -> Result<(), String>
Written as the backup’s work left it, under its lock: what you chose
meanwhile (on, given, asked) kept as the file has it.
Sourcefn save_pulled(
&self,
memory: &Path,
ended: i64,
loaded_left: &BTreeMap<String, u64>,
) -> Result<(), String>
fn save_pulled( &self, memory: &Path, ended: i64, loaded_left: &BTreeMap<String, u64>, ) -> Result<(), String>
What a pull found, written over the state as it is now, under its lock:
two processes pull (the window’s or an alarm’s, and the background
step’s), and neither undoes the other. The pull begun later says when
a pull was tried and how it went; the latest that went through is kept;
what was fetched and looked through, each file’s and folder’s latest;
what is left to the sync app (left): as it is now, with what this
pull found left added (new, or at another size) and what it found
brought taken out, from what it knew when it began (loaded_left):
another pull’s finding meanwhile is
never erased, only a look that finds it brought clears it; the rest
(your choices, the place) as it is now. A place changed meanwhile
(found elsewhere): what this pull found is not that place’s, left out.
ended: this pull’s last moment by the clock it began by (Unix
seconds); one said begun after that began after this pull ended,
which no pull of the other process can: the clock was set back since,
and this pull is the later.
Sourcepub fn choose(
memory: &Path,
change: impl FnOnce(&mut State),
) -> Result<State, String>
pub fn choose( memory: &Path, change: impl FnOnce(&mut State), ) -> Result<State, String>
What you choose (the switch, the place given by hand), changed under its lock.
Sourcepub fn confirmed_for(&self, folder: &Path) -> bool
pub fn confirmed_for(&self, folder: &Path) -> bool
Its server’s seal was found to be this folder’s.
Sourcepub fn pulls_well(&self, folder: &Path) -> bool
pub fn pulls_well(&self, folder: &Path) -> bool
Pulling from the server works for folder beside a sync app: switched
on, the folder confirmed there, a pull gone through and the last one
too (said empty). A phone’s background step then reads the other
devices’ news from its pull alone, the sync app neither asked to look
nor waited for (docs/android.md, “In the background”); otherwise, as
before: the sync app asked, and given twenty seconds.
Sourcepub fn went_through_since(&self, folder: &Path, since: i64, now: i64) -> bool
pub fn went_through_since(&self, folder: &Path, since: i64, now: i64) -> bool
A pull begun at or after since and not after now (Unix seconds)
went through, with nothing left on the server that only the sync app
brings: what a dose’s or a waking’s alarm trusts alone (alarm_news).
A pull said begun after now is one from before the clock was set back:
not since, pulled again.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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 more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.