pub enum PolicyCommand {
All,
Select,
Insert,
Update,
Delete,
}Expand description
The command kind a policy applies to.
Variants§
All
FOR ALL — covers SELECT, INSERT, UPDATE, DELETE.
Select
FOR SELECT.
Insert
FOR INSERT.
Update
FOR UPDATE.
Delete
FOR DELETE.
Implementations§
Source§impl PolicyCommand
impl PolicyCommand
Sourcepub const fn sql_keyword(self) -> &'static str
pub const fn sql_keyword(self) -> &'static str
SQL keyword used in CREATE POLICY rendering.
Sourcepub fn from_pg_text(s: &str) -> Option<Self>
pub fn from_pg_text(s: &str) -> Option<Self>
pg_policies.cmd text value. PG emits one of these strings.
Sourcepub const fn allows_with_check(self) -> bool
pub const fn allows_with_check(self) -> bool
Whether WITH CHECK is valid for this command. PG rejects WITH CHECK
on FOR SELECT and FOR DELETE policies.
Sourcepub const fn allows_using(self) -> bool
pub const fn allows_using(self) -> bool
Whether USING is valid for this command. PG rejects USING on FOR
INSERT policies (only WITH CHECK expression allowed for INSERT).
Trait Implementations§
Source§impl Clone for PolicyCommand
impl Clone for PolicyCommand
Source§fn clone(&self) -> PolicyCommand
fn clone(&self) -> PolicyCommand
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 moreimpl Copy for PolicyCommand
Source§impl Debug for PolicyCommand
impl Debug for PolicyCommand
Source§impl<'de> Deserialize<'de> for PolicyCommand
impl<'de> Deserialize<'de> for PolicyCommand
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
impl Eq for PolicyCommand
Source§impl Hash for PolicyCommand
impl Hash for PolicyCommand
Source§impl Ord for PolicyCommand
impl Ord for PolicyCommand
Source§fn cmp(&self, other: &PolicyCommand) -> Ordering
fn cmp(&self, other: &PolicyCommand) -> 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 PolicyCommand
impl PartialEq for PolicyCommand
Source§fn eq(&self, other: &PolicyCommand) -> bool
fn eq(&self, other: &PolicyCommand) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PolicyCommand
impl PartialOrd for PolicyCommand
Source§impl Serialize for PolicyCommand
impl Serialize for PolicyCommand
impl StructuralPartialEq for PolicyCommand
Auto Trait Implementations§
impl Freeze for PolicyCommand
impl RefUnwindSafe for PolicyCommand
impl Send for PolicyCommand
impl Sync for PolicyCommand
impl Unpin for PolicyCommand
impl UnsafeUnpin for PolicyCommand
impl UnwindSafe for PolicyCommand
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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