pub struct Grant {
pub privilege: Privilege,
pub target: GrantTarget,
pub grantee: String,
pub grantor: Option<String>,
pub with_grant_option: bool,
}Expand description
Grant/Revoke operations
Fields§
§privilege: Privilege§target: GrantTarget§grantee: String§grantor: Option<String>§with_grant_option: boolImplementations§
Source§impl Grant
impl Grant
Sourcepub fn new(
privilege: Privilege,
target: GrantTarget,
grantee: impl Into<String>,
) -> Self
pub fn new( privilege: Privilege, target: GrantTarget, grantee: impl Into<String>, ) -> Self
Create a new grant
Sourcepub fn with_grantor(self, grantor: impl Into<String>) -> Self
pub fn with_grantor(self, grantor: impl Into<String>) -> Self
Set grantor
Sourcepub fn with_grant_option(self, with_grant_option: bool) -> Self
pub fn with_grant_option(self, with_grant_option: bool) -> Self
Enable grant option
Sourcepub fn privilege_name(&self) -> String
pub fn privilege_name(&self) -> String
Get privilege name as string
Sourcepub fn generate_name(&self) -> String
pub fn generate_name(&self) -> String
Generate unique name for this grant
Sourcepub fn generate_grant_ddl(&self) -> String
pub fn generate_grant_ddl(&self) -> String
Generate GRANT DDL
Sourcepub fn generate_revoke_ddl(&self) -> String
pub fn generate_revoke_ddl(&self) -> String
Generate REVOKE DDL
Trait Implementations§
impl StructuralPartialEq for Grant
Auto Trait Implementations§
impl Freeze for Grant
impl RefUnwindSafe for Grant
impl Send for Grant
impl Sync for Grant
impl Unpin for Grant
impl UnsafeUnpin for Grant
impl UnwindSafe 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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> 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>
Converts
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>
Converts
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