pub struct Router {
pub router: Option<Eui>,
pub muxs: Option<Eui>,
pub uri: Option<String>,
pub error: Option<String>,
}Expand description
What the discovery endpoint answers: where to connect, or why not.
Fields§
§router: Option<Eui>The station, as the server read it.
muxs: Option<Eui>The server endpoint that will carry the session.
uri: Option<String>The websocket to open, absolute.
error: Option<String>Why the station was refused, when it was.
Implementations§
Source§impl Router
impl Router
Sourcepub fn from_json(body: &[u8]) -> Result<Router, ProtocolError>
pub fn from_json(body: &[u8]) -> Result<Router, ProtocolError>
Reads the answer, as a station does.
§Arguments
body- the answer body.
§Returns
The answer, whose error says whether the station was refused.
§Errors
Returns ProtocolError::Payload when the body is not JSON.
Trait Implementations§
impl Eq for Router
impl StructuralPartialEq for Router
Auto Trait Implementations§
impl Freeze for Router
impl RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnsafeUnpin for Router
impl UnwindSafe for Router
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