pub enum Protocol {
HTTP,
HTTPS,
Unknown(String),
}
Expand description
Defines the Protocol
enum, representing HTTP-related protocols.
The Protocol
enum includes:
HTTP
: Represents the HTTP protocol.HTTPS
: Represents the HTTPS protocol.
Variants§
Implementations§
Source§impl Protocol
Provides utility methods for the Protocol
type.
impl Protocol
Provides utility methods for the Protocol
type.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new instance of Protocol
with the default value of Self::HTTP
.
This is a shorthand for using the default
method.
Sourcepub fn is_http(&self) -> bool
pub fn is_http(&self) -> bool
Checks if the current protocol is HTTP
.
Returns true
if the protocol is HTTP
, otherwise returns false
.
Trait Implementations§
impl Eq for Protocol
impl StructuralPartialEq for Protocol
Auto Trait Implementations§
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
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