pub struct TransferRequest { /* private fields */ }Expand description
Descriptor-confined transfer request between managed hosts.
Implementations§
Source§impl TransferRequest
impl TransferRequest
Sourcepub fn new(
source_host: HostId,
source_path: impl Into<PathBuf>,
destination_host: HostId,
destination_path: impl Into<PathBuf>,
max_bytes: u64,
deadline: Timestamp,
) -> Result<Self, RequestError>
pub fn new( source_host: HostId, source_path: impl Into<PathBuf>, destination_host: HostId, destination_path: impl Into<PathBuf>, max_bytes: u64, deadline: Timestamp, ) -> Result<Self, RequestError>
Creates a validated bounded transfer request.
Sourcepub fn with_expected_source_sha256(self, sha256: impl Into<String>) -> Self
pub fn with_expected_source_sha256(self, sha256: impl Into<String>) -> Self
Binds the pre-checked source SHA-256 that the bytes read for send must match.
When set, a transfer implementation must hash the bytes it actually reads for send and reject the transfer before any destination write if the digest has drifted from this pre-checked value.
Sourcepub fn expected_source_sha256(&self) -> Option<&str>
pub fn expected_source_sha256(&self) -> Option<&str>
Returns the pre-checked source SHA-256 bound at plan time, when present.
Sourcepub fn validate_at(&self, now: Timestamp) -> Result<(), RequestError>
pub fn validate_at(&self, now: Timestamp) -> Result<(), RequestError>
Rejects a request whose deadline has elapsed.
Sourcepub fn source_host(&self) -> &HostId
pub fn source_host(&self) -> &HostId
Returns the source host.
Sourcepub fn source_path(&self) -> &Path
pub fn source_path(&self) -> &Path
Returns the source absolute path.
Sourcepub fn destination_host(&self) -> &HostId
pub fn destination_host(&self) -> &HostId
Returns the destination host.
Sourcepub fn destination_path(&self) -> &Path
pub fn destination_path(&self) -> &Path
Returns the destination absolute path.
Trait Implementations§
Source§impl Clone for TransferRequest
impl Clone for TransferRequest
Source§fn clone(&self) -> TransferRequest
fn clone(&self) -> TransferRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransferRequest
impl Debug for TransferRequest
Source§impl<'de> Deserialize<'de> for TransferRequest
impl<'de> Deserialize<'de> for TransferRequest
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TransferRequest
impl PartialEq for TransferRequest
Source§fn eq(&self, other: &TransferRequest) -> bool
fn eq(&self, other: &TransferRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TransferRequest
impl Serialize for TransferRequest
impl Eq for TransferRequest
impl StructuralPartialEq for TransferRequest
Auto Trait Implementations§
impl Freeze for TransferRequest
impl RefUnwindSafe for TransferRequest
impl Send for TransferRequest
impl Sync for TransferRequest
impl Unpin for TransferRequest
impl UnsafeUnpin for TransferRequest
impl UnwindSafe for TransferRequest
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<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
Compare self to
key and return true if they are equal.