pub struct ConnectOffer {
pub mapping: Vec<(u16, Rc<String>)>,
/* private fields */
}Expand description
Fields§
§mapping: Vec<(u16, Rc<String>)>The offered port mapping
Implementations§
Source§impl ConnectOffer
impl ConnectOffer
Sourcepub async fn accept(
self,
cancel: impl Future<Output = ()>,
) -> Result<(), ForwardingError>
pub async fn accept( self, cancel: impl Future<Output = ()>, ) -> Result<(), ForwardingError>
Accept the offer and start the forwarding
The method will run until an error occurs, the peer terminates the connection
or cancel resolves. The last one can be used to provide timeouts or to inject CTRL-C
handling. If you want the forward to never (successfully) stop, pass futures::future::pending()
as the value.
Sourcepub async fn reject(self) -> Result<(), ForwardingError>
pub async fn reject(self) -> Result<(), ForwardingError>
Reject the offer
This will send an error message to the other side so that it knows the transfer failed.
Auto Trait Implementations§
impl Freeze for ConnectOffer
impl !RefUnwindSafe for ConnectOffer
impl !Send for ConnectOffer
impl !Sync for ConnectOffer
impl Unpin for ConnectOffer
impl UnsafeUnpin for ConnectOffer
impl !UnwindSafe for ConnectOffer
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> 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