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.)