pub enum PolicyLevel {
User = 0,
Project = 1,
Session = 2,
}Expand description
Policy level — where a policy file lives in the precedence hierarchy.
Higher-precedence levels override lower ones: Session > Project > User.
Variants§
User = 0
User-level policy: ~/.clash/policy.star
Project = 1
Project-level policy: <project_root>/.clash/policy.star
Session = 2
Session-level policy: /tmp/clash-<session_id>/policy.star
Temporary rules that last only for the current Claude Code session.
Implementations§
Source§impl PolicyLevel
impl PolicyLevel
Sourcepub fn all_by_precedence() -> &'static [PolicyLevel]
pub fn all_by_precedence() -> &'static [PolicyLevel]
All persistent levels in precedence order (highest first). Session is excluded because it requires a session_id to resolve.
Trait Implementations§
Source§impl Clone for PolicyLevel
impl Clone for PolicyLevel
Source§fn clone(&self) -> PolicyLevel
fn clone(&self) -> PolicyLevel
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 PolicyLevel
impl Debug for PolicyLevel
Source§impl<'de> Deserialize<'de> for PolicyLevel
impl<'de> Deserialize<'de> for PolicyLevel
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
Source§impl Display for PolicyLevel
impl Display for PolicyLevel
Source§impl FromStr for PolicyLevel
impl FromStr for PolicyLevel
Source§impl Hash for PolicyLevel
impl Hash for PolicyLevel
Source§impl Ord for PolicyLevel
impl Ord for PolicyLevel
Source§fn cmp(&self, other: &PolicyLevel) -> Ordering
fn cmp(&self, other: &PolicyLevel) -> Ordering
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 PartialEq for PolicyLevel
impl PartialEq for PolicyLevel
Source§fn eq(&self, other: &PolicyLevel) -> bool
fn eq(&self, other: &PolicyLevel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PolicyLevel
impl PartialOrd for PolicyLevel
Source§impl Serialize for PolicyLevel
impl Serialize for PolicyLevel
impl Copy for PolicyLevel
impl Eq for PolicyLevel
impl StructuralPartialEq for PolicyLevel
Auto Trait Implementations§
impl Freeze for PolicyLevel
impl RefUnwindSafe for PolicyLevel
impl Send for PolicyLevel
impl Sync for PolicyLevel
impl Unpin for PolicyLevel
impl UnsafeUnpin for PolicyLevel
impl UnwindSafe for PolicyLevel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.