pub enum FilesAvailable {
File {
name: String,
size: u64,
},
Dir {
name: String,
files: Vec<FilesAvailable>,
},
}Expand description
Tree structure that represents the files that are available
Variants§
Implementations§
Source§impl FilesAvailable
impl FilesAvailable
Sourcepub fn to_send_recv_tree(&self) -> FileSendRecvTree
pub fn to_send_recv_tree(&self) -> FileSendRecvTree
Convert the tree to a FileSendRecvTree
Sourcepub fn remove_skipped(&self, to_skip: &FilesToSkip) -> Option<FileSendRecvTree>
pub fn remove_skipped(&self, to_skip: &FilesToSkip) -> Option<FileSendRecvTree>
Fully/partially remove skipped files from the tree
- Returns std::option::Option::None if the tree is fully skipped
- panics if the tree roots do not match
Sourcepub fn get_skippable(&self, local_files: &FilesAvailable) -> Option<FilesToSkip>
pub fn get_skippable(&self, local_files: &FilesAvailable) -> Option<FilesToSkip>
Compare two trees and return the files that can be skipped.
(e.g. compare local and remote files, returning those that can be skipped during transfer).
it is expected that self is larger than local_files
§Returns
- std::option::Option::None if no files can be skipped
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for FilesAvailable
impl<'__de, __Context> BorrowDecode<'__de, __Context> for FilesAvailable
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for FilesAvailable
impl Clone for FilesAvailable
Source§fn clone(&self) -> FilesAvailable
fn clone(&self) -> FilesAvailable
Returns a duplicate 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 FilesAvailable
impl Debug for FilesAvailable
Source§impl<__Context> Decode<__Context> for FilesAvailable
impl<__Context> Decode<__Context> for FilesAvailable
Source§impl<'de> Deserialize<'de> for FilesAvailable
impl<'de> Deserialize<'de> for FilesAvailable
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 Encode for FilesAvailable
impl Encode for FilesAvailable
Source§impl Hash for FilesAvailable
impl Hash for FilesAvailable
Source§impl PartialEq for FilesAvailable
impl PartialEq for FilesAvailable
Source§impl Serialize for FilesAvailable
impl Serialize for FilesAvailable
impl StructuralPartialEq for FilesAvailable
Auto Trait Implementations§
impl Freeze for FilesAvailable
impl RefUnwindSafe for FilesAvailable
impl Send for FilesAvailable
impl Sync for FilesAvailable
impl Unpin for FilesAvailable
impl UnwindSafe for FilesAvailable
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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