Skip to content

Instantly share code, notes, and snippets.

@ctaggart
Created June 26, 2020 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctaggart/60b898fdbb37c72407d02486f5bed8d8 to your computer and use it in GitHub Desktop.
Save ctaggart/60b898fdbb37c72407d02486f5bed8d8 to your computer and use it in GitHub Desktop.
impl AsRef<OutgoingMessage> for ServerResponse {
fn as_ref(&self) -> &OutgoingMessage {
self.unchecked_ref()
}
}
impl From<ServerResponse> for OutgoingMessage {
fn from(child: ServerResponse) -> Self {
child.unchecked_into()
}
}
impl ServerResponse {
pub fn to_outgoing_message(self) -> OutgoingMessage {
self.unchecked_into()
}
pub fn as_outgoing_message(&self) -> &OutgoingMessage {
self.unchecked_ref()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment