pub enum Event {
Request(Request),
NormalResponse(Response),
InformationalResponse(Response),
Data(Data),
EndOfMessage(EndOfMessage),
ConnectionClosed(ConnectionClosed),
NeedData(),
Paused(),
}Expand description
Protocol events emitted and accepted by crate::Connection.
Variants§
Request(Request)
Request head event.
NormalResponse(Response)
Final response head event with status code >= 200.
InformationalResponse(Response)
Informational response head event with status code in 100..=199.
Data(Data)
Message body data.
EndOfMessage(EndOfMessage)
End of a request or response message.
ConnectionClosed(ConnectionClosed)
Connection close notification.
NeedData()
More bytes are needed before another inbound event can be produced.
Paused()
Inbound data is paused until the current cycle is completed.
Implementations§
Source§impl Event
impl Event
Sourcepub fn informational_response(response: Response) -> Result<Self, ProtocolError>
pub fn informational_response(response: Response) -> Result<Self, ProtocolError>
Converts a validated response into an informational response event.
Sourcepub fn normal_response(response: Response) -> Result<Self, ProtocolError>
pub fn normal_response(response: Response) -> Result<Self, ProtocolError>
Converts a validated response into a final response event.
Trait Implementations§
Source§impl From<ConnectionClosed> for Event
impl From<ConnectionClosed> for Event
Source§fn from(connection_closed: ConnectionClosed) -> Self
fn from(connection_closed: ConnectionClosed) -> Self
Converts to this type from the input type.
Source§impl From<EndOfMessage> for Event
impl From<EndOfMessage> for Event
Source§fn from(end_of_message: EndOfMessage) -> Self
fn from(end_of_message: EndOfMessage) -> Self
Converts to this type from the input type.
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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