pub struct CommandResponse {
pub reply: CommandReply,
pub address: Address,
}Expand description
CommandResponse message:
+-----+-------+------+----------+----------+
| REP | RSV | ATYP | BND.ADDR | BND.PORT |
+-----+-------+------+----------+----------+
| 1 | X'00' | 1 | Variable | 2 |
+-----+-------+------+----------+----------+
Fields§
§reply: CommandReplyReply (REP).
address: AddressAddress (ATYP, BND.ADDR, BND.PORT).
Implementations§
Source§impl CommandResponse
impl CommandResponse
Sourcepub fn success(address: Address) -> CommandResponse
pub fn success(address: Address) -> CommandResponse
Create a success CommandResponse with bind address.
Sourcepub fn reply_error(reply: CommandReply) -> CommandResponse
pub fn reply_error(reply: CommandReply) -> CommandResponse
Create a error CommandResponse with reply.
Sourcepub fn error(e: impl TryInto<Error>) -> CommandResponse
pub fn error(e: impl TryInto<Error>) -> CommandResponse
Create a error CommandResponse with any io::error.
Trait Implementations§
Source§impl Debug for CommandResponse
impl Debug for CommandResponse
Auto Trait Implementations§
impl Freeze for CommandResponse
impl RefUnwindSafe for CommandResponse
impl Send for CommandResponse
impl Sync for CommandResponse
impl Unpin for CommandResponse
impl UnwindSafe for CommandResponse
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