pub enum NegotiationOutcome {
Accepted {
header_value: String,
metadata: ProtocolMetadata,
},
NotRequested,
NoMatch {
requested: Vec<String>,
},
}Expand description
协商结果,携带详细的匹配信息。
Variants§
Implementations§
Source§impl NegotiationOutcome
impl NegotiationOutcome
Sourcepub fn is_accepted(&self) -> bool
pub fn is_accepted(&self) -> bool
判断是否协商成功
Sourcepub fn header_value(&self) -> Option<&str>
pub fn header_value(&self) -> Option<&str>
获取选定协议的 header 值(协商失败时返回 None)
Trait Implementations§
Source§impl Clone for NegotiationOutcome
impl Clone for NegotiationOutcome
Source§fn clone(&self) -> NegotiationOutcome
fn clone(&self) -> NegotiationOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 NegotiationOutcome
impl Debug for NegotiationOutcome
impl Eq for NegotiationOutcome
Source§impl PartialEq for NegotiationOutcome
impl PartialEq for NegotiationOutcome
impl StructuralPartialEq for NegotiationOutcome
Auto Trait Implementations§
impl Freeze for NegotiationOutcome
impl RefUnwindSafe for NegotiationOutcome
impl Send for NegotiationOutcome
impl Sync for NegotiationOutcome
impl Unpin for NegotiationOutcome
impl UnsafeUnpin for NegotiationOutcome
impl UnwindSafe for NegotiationOutcome
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