Struct biscuit_auth::builder::Policy
source · pub struct Policy {
pub queries: Vec<Rule>,
pub kind: PolicyKind,
}Expand description
Builder for a Biscuit policy
Fields§
§queries: Vec<Rule>§kind: PolicyKindImplementations§
source§impl Policy
impl Policy
sourcepub fn set<T: Into<Term>>(&mut self, name: &str, term: T) -> Result<(), Token>
pub fn set<T: Into<Term>>(&mut self, name: &str, term: T) -> Result<(), Token>
replace a parameter with the term argument
pub fn set_inner(&mut self, name: &str, term: Term) -> Result<(), Token>
sourcepub fn set_scope(&mut self, name: &str, pubkey: PublicKey) -> Result<(), Token>
pub fn set_scope(&mut self, name: &str, pubkey: PublicKey) -> Result<(), Token>
replace a scope parameter with the pubkey argument
sourcepub fn set_lenient<T: Into<Term>>(
&mut self,
name: &str,
term: T
) -> Result<(), Token>
pub fn set_lenient<T: Into<Term>>( &mut self, name: &str, term: T ) -> Result<(), Token>
replace a parameter with the term argument, ignoring unknown parameters
sourcepub fn set_scope_lenient(
&mut self,
name: &str,
pubkey: PublicKey
) -> Result<(), Token>
pub fn set_scope_lenient( &mut self, name: &str, pubkey: PublicKey ) -> Result<(), Token>
replace a scope parameter with the pubkey argument, ignoring unknown parameters
pub fn set_macro_param<T: ToAnyParam>( &mut self, name: &str, param: T ) -> Result<(), Token>
pub fn validate_parameters(&self) -> Result<(), Token>
Trait Implementations§
source§impl PartialEq<Policy> for Policy
impl PartialEq<Policy> for Policy
impl Eq for Policy
impl StructuralEq for Policy
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
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