pub struct DirectiveMatch {
pub tenant: Option<PartitionId>,
pub index: Option<IndexName>,
pub principal: Option<PrincipalId>,
pub endpoint: Option<EndpointKind>,
}Expand description
What a directive targets. A request matches when every set field equals the request’s corresponding attribute; an unset field is a wildcard, so an all-unset match targets every request.
Fields§
§tenant: Option<PartitionId>Match only this partition/tenant (once resolved).
index: Option<IndexName>Match only this logical index.
principal: Option<PrincipalId>Match only this principal.
endpoint: Option<EndpointKind>Match only this endpoint class.
Implementations§
Source§impl DirectiveMatch
impl DirectiveMatch
Sourcepub fn for_tenant(self, tenant: PartitionId) -> Self
pub fn for_tenant(self, tenant: PartitionId) -> Self
Narrows the match to tenant (builder style).
Sourcepub fn for_principal(self, principal: PrincipalId) -> Self
pub fn for_principal(self, principal: PrincipalId) -> Self
Narrows the match to principal (builder style).
Sourcepub fn for_endpoint(self, endpoint: EndpointKind) -> Self
pub fn for_endpoint(self, endpoint: EndpointKind) -> Self
Narrows the match to endpoint (builder style).
Sourcepub fn matches(&self, attrs: &RequestAttrs<'_>) -> bool
pub fn matches(&self, attrs: &RequestAttrs<'_>) -> bool
Whether attrs satisfies every set field of this match.
Trait Implementations§
Source§impl Clone for DirectiveMatch
impl Clone for DirectiveMatch
Source§fn clone(&self) -> DirectiveMatch
fn clone(&self) -> DirectiveMatch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DirectiveMatch
impl Debug for DirectiveMatch
Source§impl Default for DirectiveMatch
impl Default for DirectiveMatch
Source§fn default() -> DirectiveMatch
fn default() -> DirectiveMatch
Returns the “default value” for a type. Read more
impl Eq for DirectiveMatch
Source§impl PartialEq for DirectiveMatch
impl PartialEq for DirectiveMatch
Source§fn eq(&self, other: &DirectiveMatch) -> bool
fn eq(&self, other: &DirectiveMatch) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DirectiveMatch
Auto Trait Implementations§
impl Freeze for DirectiveMatch
impl RefUnwindSafe for DirectiveMatch
impl Send for DirectiveMatch
impl Sync for DirectiveMatch
impl Unpin for DirectiveMatch
impl UnsafeUnpin for DirectiveMatch
impl UnwindSafe for DirectiveMatch
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