pub struct PathStrategy {
pub policies: Vec<Arc<dyn PathPolicy>>,
/* private fields */
}Expand description
PathStrategy combines multiple path operations into a single strategy.
Fields§
§policies: Vec<Arc<dyn PathPolicy>>The path policies to apply.
Implementations§
Source§impl PathStrategy
impl PathStrategy
Sourcepub fn add_policy(&mut self, policy: impl PathPolicy)
pub fn add_policy(&mut self, policy: impl PathPolicy)
Appends a path policy to the list of policies.
Sourcepub fn predicate(&self, path: &ScionPath) -> bool
pub fn predicate(&self, path: &ScionPath) -> bool
Returns true if the given path is accepted by all policies.
If no policies are added, all paths are accepted.
Sourcepub fn filter_inplace(&self, paths: &mut Vec<ScionPath>)
pub fn filter_inplace(&self, paths: &mut Vec<ScionPath>)
Filters the given paths based on all policies, removing paths that are not accepted.
Trait Implementations§
Source§impl Default for PathStrategy
impl Default for PathStrategy
Source§fn default() -> PathStrategy
fn default() -> PathStrategy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PathStrategy
impl !UnwindSafe for PathStrategy
impl Freeze for PathStrategy
impl Send for PathStrategy
impl Sync for PathStrategy
impl Unpin for PathStrategy
impl UnsafeUnpin for PathStrategy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request