pub struct HttpRule {
pub method: String,
pub host: String,
pub path: String,
}Expand description
An HTTP access control rule.
Fields§
§method: String§host: String§path: StringImplementations§
Source§impl HttpRule
impl HttpRule
Sourcepub fn parse(s: &str) -> Result<Self, PolicyError>
pub fn parse(s: &str) -> Result<Self, PolicyError>
Parse a rule from “METHOD host/path” format.
Examples:
"GET api.example.com/v1/*"→ method=“GET”, host=“api.example.com”, path=“/v1/*”"* */admin/*"→ method=“”, host=“”, path=“/admin/*”"GET example.com"→ method=“GET”, host=“example.com”, path=“/*”
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HttpRule
impl<'de> Deserialize<'de> for HttpRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for HttpRule
Auto Trait Implementations§
impl Freeze for HttpRule
impl RefUnwindSafe for HttpRule
impl Send for HttpRule
impl Sync for HttpRule
impl Unpin for HttpRule
impl UnsafeUnpin for HttpRule
impl UnwindSafe for HttpRule
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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