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 !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