Enum ToolAccess
#[non_exhaustive]pub enum ToolAccess {
Independent,
Uses(Vec<Use>),
Alone,
}Expand description
What a call shares with the other calls of its turn: see Tool::access.
Two calls conflict when one of them is Alone, or when they have
overlapping Uses and at least one writes. Calls that conflict keep the model’s order;
every other call starts as soon as fewer than the limit run.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Independent
Shares nothing with the run’s other calls.
Uses(Vec<Use>)
Uses the named scopes; conflicts only with calls that use an overlapping one in a way that
includes a write. An empty list is Independent.
Alone
Runs by itself: every earlier call has finished and been applied, and nothing after it starts before it is done. The default, so that a tool that declares nothing is safe.
Implementations§
§impl ToolAccess
impl ToolAccess
pub fn reads(scope: impl Into<String>) -> ToolAccess
pub fn reads(scope: impl Into<String>) -> ToolAccess
A read of the one scope scope.
pub fn writes(scope: impl Into<String>) -> ToolAccess
pub fn writes(scope: impl Into<String>) -> ToolAccess
A write of the one scope scope.
pub fn reads_path(base: &str, path: Option<&str>) -> ToolAccess
pub fn reads_path(base: &str, path: Option<&str>) -> ToolAccess
A read of base, or of base/<path> when path names one place under it: see path_scope.
pub fn writes_path(base: &str, path: Option<&str>) -> ToolAccess
pub fn writes_path(base: &str, path: Option<&str>) -> ToolAccess
A write of base, or of base/<path>: see path_scope.
pub fn is_alone(&self) -> bool
pub fn is_alone(&self) -> bool
Whether a call with this access may run in the same segment as another call at all.
pub fn uses(&self) -> Option<&[Use]>
pub fn uses(&self) -> Option<&[Use]>
The uses of the access: none for Independent, None for
Alone, which conflicts with everything.
pub fn conflicts(&self, other: &ToolAccess) -> bool
pub fn conflicts(&self, other: &ToolAccess) -> bool
Whether a call with this access and one with other must not run together.
Trait Implementations§
§impl Clone for ToolAccess
impl Clone for ToolAccess
§fn clone(&self) -> ToolAccess
fn clone(&self) -> ToolAccess
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ToolAccess
impl Debug for ToolAccess
§impl Default for ToolAccess
impl Default for ToolAccess
§fn default() -> ToolAccess
fn default() -> ToolAccess
impl Eq for ToolAccess
§impl PartialEq for ToolAccess
impl PartialEq for ToolAccess
impl StructuralPartialEq for ToolAccess
Auto Trait Implementations§
impl Freeze for ToolAccess
impl RefUnwindSafe for ToolAccess
impl Send for ToolAccess
impl Sync for ToolAccess
impl Unpin for ToolAccess
impl UnsafeUnpin for ToolAccess
impl UnwindSafe for ToolAccess
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].