pub struct StreamId(pub String);Expand description
A unique identifier for a Tor stream.
Stream IDs are assigned by Tor when streams are created and are used to reference specific streams in control protocol commands. Streams represent individual TCP connections being routed through Tor circuits.
§Invariants
- Stream IDs are unique within a Tor session
- IDs are assigned sequentially by Tor
- An ID remains valid until the stream is closed
§Example
use stem_rs::controller::StreamId;
let id = StreamId::new("99");
assert_eq!(id.to_string(), "99");
// StreamIds can be compared for equality
let id2 = StreamId::new("99");
assert_eq!(id, id2);§See Also
Controller::get_streams: Retrieve active streamsController::attach_stream: Attach a stream to a circuitController::close_stream: Close a stream by ID
Tuple Fields§
§0: StringImplementations§
Trait Implementations§
impl Eq for StreamId
impl StructuralPartialEq for StreamId
Auto Trait Implementations§
impl Freeze for StreamId
impl RefUnwindSafe for StreamId
impl Send for StreamId
impl Sync for StreamId
impl Unpin for StreamId
impl UnwindSafe for StreamId
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