pub enum ServerDecision {
Echoed(ProtocolVersion),
CounterOffered {
offered: ProtocolVersion,
answer: ProtocolVersion,
},
}Expand description
What the server decided to speak.
Echo and counter-offer are different outcomes and callers need to tell them
apart: a bridge that was downgraded wants to log it, and
server/discover advertises what is supported rather than what a
particular client was given.
Variants§
Echoed(ProtocolVersion)
The client asked for something the server speaks, and got it.
CounterOffered
The client asked for something the server does not speak. Not an error: the server answers with its latest, per the lifecycle spec.
Fields
§
offered: ProtocolVersionWhat the client asked for.
§
answer: ProtocolVersionWhat the server speaks instead.
Implementations§
Source§impl ServerDecision
impl ServerDecision
Sourcepub const fn version(self) -> ProtocolVersion
pub const fn version(self) -> ProtocolVersion
The version the session will speak either way.
Sourcepub const fn is_counter_offer(self) -> bool
pub const fn is_counter_offer(self) -> bool
Whether the client was downgraded.
Trait Implementations§
Source§impl Clone for ServerDecision
impl Clone for ServerDecision
impl Copy for ServerDecision
Source§impl Debug for ServerDecision
impl Debug for ServerDecision
impl Eq for ServerDecision
Source§impl PartialEq for ServerDecision
impl PartialEq for ServerDecision
impl StructuralPartialEq for ServerDecision
Auto Trait Implementations§
impl Freeze for ServerDecision
impl RefUnwindSafe for ServerDecision
impl Send for ServerDecision
impl Sync for ServerDecision
impl Unpin for ServerDecision
impl UnsafeUnpin for ServerDecision
impl UnwindSafe for ServerDecision
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