pub struct LocalFileTransfer { /* private fields */ }Expand description
The reference file_transfer implementation.
Implementations§
Source§impl LocalFileTransfer
impl LocalFileTransfer
pub fn new( config: FileTransferConfig, api: AttaccaApiClient, tofu: TofuStore, confirmer: Arc<dyn PeerConfirmer>, link: Arc<dyn PeerLink>, ) -> LocalFileTransfer
Sourcepub fn pending(
config: FileTransferConfig,
tofu: TofuStore,
confirmer: Arc<dyn PeerConfirmer>,
link: Arc<dyn PeerLink>,
) -> LocalFileTransfer
pub fn pending( config: FileTransferConfig, tofu: TofuStore, confirmer: Arc<dyn PeerConfirmer>, link: Arc<dyn PeerLink>, ) -> LocalFileTransfer
The same thing, with the rendezvous client still to come.
A node announces its capabilities before it connects, and the client is something the
connection hands back — so a node that registers this one has no client to give it yet.
Until Self::set_api is called, send_to refuses rather than pretending: there is no
way to find a peer without something to ask.
Sourcepub fn set_api(&self, api: AttaccaApiClient)
pub fn set_api(&self, api: AttaccaApiClient)
Plugs in the rendezvous client for the connection this node is on now.
Call it on every connect, not just the first. See Rendezvous.
Sourcepub fn rendezvous(&self) -> Rendezvous
pub fn rendezvous(&self) -> Rendezvous
The same handle this transfer looks peers up through, for a node that also wants to hand it
to listen::serve_peers as its directory — one client, kept current in one place,
serving both directions.
Trait Implementations§
Source§impl Clone for LocalFileTransfer
impl Clone for LocalFileTransfer
Source§fn clone(&self) -> LocalFileTransfer
fn clone(&self) -> LocalFileTransfer
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 FileTransfer for LocalFileTransfer
impl FileTransfer for LocalFileTransfer
Source§fn send_to<'life0, 'async_trait>(
&'life0 self,
node: String,
path: String,
name: Option<String>,
overwrite: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<SendReceipt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_to<'life0, 'async_trait>(
&'life0 self,
node: String,
path: String,
name: Option<String>,
overwrite: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<SendReceipt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a file on this machine to another node on the same account. Read more
Source§fn inbox_list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<InboxEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inbox_list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<InboxEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
What has arrived in this machine’s inbox.
Auto Trait Implementations§
impl !RefUnwindSafe for LocalFileTransfer
impl !UnwindSafe for LocalFileTransfer
impl Freeze for LocalFileTransfer
impl Send for LocalFileTransfer
impl Sync for LocalFileTransfer
impl Unpin for LocalFileTransfer
impl UnsafeUnpin for LocalFileTransfer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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