pub struct WebSocketRoute { /* private fields */ }Expand description
A registered WebSocket route (path + optional name + metadata).
Implementations§
Source§impl WebSocketRoute
impl WebSocketRoute
Sourcepub fn new(path: String, name: Option<String>) -> WebSocketRoute
pub fn new(path: String, name: Option<String>) -> WebSocketRoute
Creates a new route with the given path and optional name.
Sourcepub fn with_metadata(self, key: String, value: String) -> WebSocketRoute
pub fn with_metadata(self, key: String, value: String) -> WebSocketRoute
Attaches a key-value metadata entry to this route.
Sourcepub fn get_metadata(&self, key: &str) -> Option<&String>
pub fn get_metadata(&self, key: &str) -> Option<&String>
Returns the metadata value for the given key, if present.
Trait Implementations§
Source§impl Clone for WebSocketRoute
impl Clone for WebSocketRoute
Source§fn clone(&self) -> WebSocketRoute
fn clone(&self) -> WebSocketRoute
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 moreAuto Trait Implementations§
impl Freeze for WebSocketRoute
impl RefUnwindSafe for WebSocketRoute
impl Send for WebSocketRoute
impl Sync for WebSocketRoute
impl Unpin for WebSocketRoute
impl UnsafeUnpin for WebSocketRoute
impl UnwindSafe for WebSocketRoute
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more