pub enum ContentPutStep {
Begin {
size: u64,
target: Option<RemoteActionTarget>,
},
Append {
upload: u64,
offset: u64,
bytes: String,
},
Finish {
upload: u64,
},
Many {
files: Vec<String>,
target: Option<RemoteActionTarget>,
},
Have {
hashes: Vec<String>,
},
Progress {
upload: u64,
},
}Expand description
One step of an upload asked of another device over a session
(super::RemoteActionMessage::ContentPutRequest): the same begin,
append and finish a local ContentPuts takes.
Variants§
Begin
Open an upload of exactly size bytes, target being the action their arguments are for
when the caller knows it: an action of the caller’s own device keeps what it reads on that
device, and everything else a workspace’s store.
Append
Accept the next bytes at offset, hex-encoded so the frame stays
self-describing text.
Finish
Store what the upload holds.
Many
Store several whole files at once, each hex-encoded: the answer names
each one’s reference in order (ContentPutAnswer::Many), target
naming the action they are for as Self::Begin does.
Have
Ask which of these hashes (lowercase BLAKE3 hex) the store already
holds (ContentPutAnswer::Have).
Progress
Where the upload stands: answered with the bytes accepted so far
(ContentPutAnswer::Appended), so a client whose append failed on
the way resumes from there.
Implementations§
Trait Implementations§
Source§impl Clone for ContentPutStep
impl Clone for ContentPutStep
Source§impl Debug for ContentPutStep
impl Debug for ContentPutStep
Source§impl<'de> Deserialize<'de> for ContentPutStep
impl<'de> Deserialize<'de> for ContentPutStep
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 ContentPutStep
Source§impl PartialEq for ContentPutStep
impl PartialEq for ContentPutStep
Source§impl Serialize for ContentPutStep
impl Serialize for ContentPutStep
impl StructuralPartialEq for ContentPutStep
Auto Trait Implementations§
impl Forget for ContentPutStep
impl Freeze for ContentPutStep
impl Move for ContentPutStep
impl RefUnwindSafe for ContentPutStep
impl Send for ContentPutStep
impl Sync for ContentPutStep
impl Unpin for ContentPutStep
impl UnsafeUnpin for ContentPutStep
impl UnwindSafe for ContentPutStep
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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