Struct portal_lib::protocol::TransferInfo
source · pub struct TransferInfo {
pub all: Vec<Metadata>,
pub localpaths: Vec<PathBuf>,
}
Expand description
Contains the metadata for all files that will be sent during a particular transfer
Fields§
§all: Vec<Metadata>
The metadata to send to the peer. These filenames are striped of their path information
localpaths: Vec<PathBuf>
Internal state for a sender to locate files
Implementations§
source§impl TransferInfo
impl TransferInfo
sourcepub fn empty() -> TransferInfo
pub fn empty() -> TransferInfo
Owned TransferInfo
use std::path::PathBuf;
use std::error::Error;
use portal_lib::TransferInfo;
fn create_info(files: Vec<PathBuf>) -> Result<TransferInfo, Box<dyn Error>> {
let mut info = TransferInfo::empty();
for file in files {
info.add_file(file.as_path())?;
}
Ok(info)
}
Trait Implementations§
source§impl Clone for TransferInfo
impl Clone for TransferInfo
source§fn clone(&self) -> TransferInfo
fn clone(&self) -> TransferInfo
Returns a copy of the value. Read more
1.0.0 · 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 TransferInfo
impl Debug for TransferInfo
source§impl Default for TransferInfo
impl Default for TransferInfo
source§fn default() -> TransferInfo
fn default() -> TransferInfo
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TransferInfo
impl<'de> Deserialize<'de> for TransferInfo
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 TransferInfo
impl PartialEq for TransferInfo
source§fn eq(&self, other: &TransferInfo) -> bool
fn eq(&self, other: &TransferInfo) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TransferInfo
impl Serialize for TransferInfo
impl Eq for TransferInfo
impl StructuralEq for TransferInfo
impl StructuralPartialEq for TransferInfo
Auto Trait Implementations§
impl RefUnwindSafe for TransferInfo
impl Send for TransferInfo
impl Sync for TransferInfo
impl Unpin for TransferInfo
impl UnwindSafe for TransferInfo
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