pub struct Response {
packet: Option<Packet>,
close_after_response: bool,
}Expand description
Represents a response to the Minecraft client.
Fields§
§packet: Option<Packet>The packet to respond
close_after_response: boolWhether the server should close the connection after sending this response.
Implementations§
Source§impl Response
impl Response
pub fn new(packet: Option<Packet>) -> Self
Sourcepub fn get_packet(&self) -> Option<&Packet>
pub fn get_packet(&self) -> Option<&Packet>
Returns a reference to the packet
Sourcepub fn take_packet(self) -> Option<Packet>
pub fn take_packet(self) -> Option<Packet>
Consumes the Response and returns the packet
Sourcepub fn close_conn(self) -> Self
pub fn close_conn(self) -> Self
Sets the close_after_response to true, which should make the server close the connection
with the Minecraft client after sending this response.
Sourcepub fn does_close_conn(&self) -> bool
pub fn does_close_conn(&self) -> bool
Returns whether or not the connection with the Minecraft client should be closed.
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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