pub struct VersionsCell {
pub versions: Vec<u32>,
}Expand description
Link protocol version negotiation cell.
VERSIONS cells are exchanged at the start of a connection to negotiate the link protocol version. Both sides send their supported versions, and the highest mutually supported version is selected.
§Wire Format
Variable-size cell:
[ CircID (0) ][ 7 (VERSIONS) ][ Length ][ Version1 (2 bytes) ][ Version2 ]...§Protocol Notes
- VERSIONS cells always use circuit ID 0
- The first VERSIONS cell uses 2-byte circuit IDs for backward compatibility
- Versions are encoded as 2-byte big-endian integers
§Example
use stem_rs::client::cell::VersionsCell;
use stem_rs::client::datatype::LinkProtocol;
let cell = VersionsCell::new(vec![3, 4, 5]);
let packed = cell.pack(&LinkProtocol::new(2));Fields§
§versions: Vec<u32>Supported link protocol versions.
Implementations§
Source§impl VersionsCell
impl VersionsCell
Trait Implementations§
Source§impl Clone for VersionsCell
impl Clone for VersionsCell
Source§fn clone(&self) -> VersionsCell
fn clone(&self) -> VersionsCell
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VersionsCell
impl Debug for VersionsCell
Source§impl PartialEq for VersionsCell
impl PartialEq for VersionsCell
impl StructuralPartialEq for VersionsCell
Auto Trait Implementations§
impl Freeze for VersionsCell
impl RefUnwindSafe for VersionsCell
impl Send for VersionsCell
impl Sync for VersionsCell
impl Unpin for VersionsCell
impl UnwindSafe for VersionsCell
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