pub struct Scope(/* private fields */);Expand description
A normalized memory scope used for isolation and retention decisions.
The value is slash-delimited text. Empty path segments are removed and
leading/trailing slashes are ignored, so "/tenant/a/" and "tenant/a"
normalize to the same scope.
§Example
use rig_memory_policy::Scope;
let scope = Scope::new("/tenant-a/project-1/");
assert_eq!(scope.as_str(), "tenant-a/project-1");
assert_eq!(scope.path(), vec!["tenant-a", "project-1"]);Implementations§
Trait Implementations§
Source§impl Ord for Scope
impl Ord for Scope
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Scope
impl PartialOrd for Scope
impl Eq for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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