Struct tor_proto::stream::IncomingStream
source · pub struct IncomingStream { /* private fields */ }Available on crate feature
hs-service only.Expand description
A pending request from the other end of the circuit for us to open a new stream.
Exits, directory caches, and onion services expect to receive these; others do not.
On receiving one of these objects, the party handling it should accept it or reject it. If it is dropped without being explicitly handled, a reject message will be sent anyway.
Implementations§
source§impl IncomingStream
impl IncomingStream
sourcepub fn request(&self) -> IncomingStreamRequest
pub fn request(&self) -> IncomingStreamRequest
Return the underlying message that was used to try to begin this stream.
sourcepub fn accept_data(self, message: Connected) -> DataStream
pub fn accept_data(self, message: Connected) -> DataStream
Accept this stream as a new DataStream, and send the client a
message letting them know the stream was accepted.
sourcepub fn discard(self)
pub fn discard(self)
Ignore this request without replying to the client.
(If you drop an IncomingStream without calling accept_data,
reject, or this method, the drop handler will cause it to be
rejected.)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for IncomingStream
impl Send for IncomingStream
impl Sync for IncomingStream
impl Unpin for IncomingStream
impl !UnwindSafe for IncomingStream
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