pub struct Grant {
pub actions: BTreeSet<ActionClass>,
pub databases: BTreeSet<String>,
pub view: Option<Arc<dyn ViewFilter>>,
}Expand description
A grant held by a role: which actions, over which databases, with what view.
Fields§
§actions: BTreeSet<ActionClass>Actions this grant permits. Empty means “any action”.
databases: BTreeSet<String>Databases this grant covers. Empty means “any database”.
view: Option<Arc<dyn ViewFilter>>Optional view restriction applied when the grant permits a read.
Implementations§
Source§impl Grant
impl Grant
Sourcepub fn new(
actions: impl IntoIterator<Item = ActionClass>,
databases: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn new( actions: impl IntoIterator<Item = ActionClass>, databases: impl IntoIterator<Item = impl Into<String>>, ) -> Self
A grant permitting actions over databases.
Sourcepub fn with_view(self, view: Arc<dyn ViewFilter>) -> Self
pub fn with_view(self, view: Arc<dyn ViewFilter>) -> Self
Attaches a view restriction (builder style).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Grant
impl !UnwindSafe for Grant
impl Freeze for Grant
impl Send for Grant
impl Sync for Grant
impl Unpin for Grant
impl UnsafeUnpin for Grant
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<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> 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