#[non_exhaustive]pub struct FileUploadResult {
pub data_map: DataMap,
pub chunks_stored: usize,
pub chunks_failed: usize,
pub total_chunks: usize,
pub payment_mode_used: PaymentMode,
pub storage_cost_atto: String,
pub gas_cost_wei: u128,
pub data_map_address: Option<[u8; 32]>,
}Expand description
Result of a file upload: the DataMap needed to retrieve the file.
Marked #[non_exhaustive] so adding a new field in future is not a
breaking change for downstream consumers that construct or pattern-match
on this struct.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.data_map: DataMapThe data map containing chunk metadata for reconstruction.
chunks_stored: usizeNumber of chunks stored on the network.
chunks_failed: usizeNumber of chunks that failed to store. Always 0 for a successful
upload — partial-failure information is conveyed via
crate::data::Error::PartialUpload instead.
total_chunks: usizeTotal number of chunks the upload attempted to store. On full
success this equals chunks_stored.
payment_mode_used: PaymentModeWhich payment mode was actually used (not just requested).
storage_cost_atto: StringTotal storage cost paid in token units (atto). “0” if all chunks already existed.
gas_cost_wei: u128Total gas cost in wei. 0 if no on-chain transactions were made.
data_map_address: Option<[u8; 32]>Chunk address of the serialized DataMap, set only for
Visibility::Public uploads. Some means this address is
retrievable from the network (via Client::data_map_fetch), not
necessarily that this upload paid to store it — if the serialized
DataMap hashed to a chunk that was already on the network (same
file uploaded before; deterministic via self-encryption), the address
is still returned but no storage payment was made for it.
Trait Implementations§
Source§impl Clone for FileUploadResult
impl Clone for FileUploadResult
Source§fn clone(&self) -> FileUploadResult
fn clone(&self) -> FileUploadResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FileUploadResult
impl RefUnwindSafe for FileUploadResult
impl Send for FileUploadResult
impl Sync for FileUploadResult
impl Unpin for FileUploadResult
impl UnsafeUnpin for FileUploadResult
impl UnwindSafe for FileUploadResult
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> 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