Skip to main content

Trigger

Struct Trigger 

Source
pub struct Trigger {
Show 18 fields pub oid: u32, pub relation: u32, pub name: String, pub function: u32, pub kind: i16, pub constraint_relation: u32, pub constraint_index: u32, pub constraint: u32, pub deferrable: bool, pub deferred: bool, pub enabled: u8, pub internal: bool, pub args: Vec<String>, pub columns: Vec<i16>, pub old_table: Option<String>, pub new_table: Option<String>, pub qual: Option<String>, pub parent: u32,
}
Expand description

A trigger, one row of pg_trigger: a trigger of CREATE TRIGGER, or an internal trigger of a foreign key.

Fields§

§oid: u32

The OID.

§relation: u32

The OID of the table of the trigger.

§name: String

The name.

§function: u32

The OID of the function.

§kind: i16

tgtype: the bits of the level, the time and the events.

§constraint_relation: u32

tgconstrrelid: the other table of the foreign key.

§constraint_index: u32

tgconstrindid: the unique index of the referenced table.

§constraint: u32

tgconstraint: the OID of the foreign key.

§deferrable: bool

tgdeferrable.

§deferred: bool

tginitdeferred.

§enabled: u8

tgenabled: O when the trigger fires in the origin mode, D when it is disabled, R when it fires only in the replica mode, and A when it always fires.

§internal: bool

tgisinternal: true for a trigger of a foreign key.

§args: Vec<String>

tgargs: the arguments of the function, as text.

§columns: Vec<i16>

tgattr: the numbers of the columns of UPDATE OF, in the order of the statement.

§old_table: Option<String>

tgoldtable: the name of the transition table of REFERENCING OLD TABLE.

§new_table: Option<String>

tgnewtable: the name of the transition table of REFERENCING NEW TABLE.

§qual: Option<String>

tgqual: the stored form of the condition of WHEN, in which the relation 0 is old and the relation 1 is new.

§parent: u32

tgparentid: the trigger of the parent table that the trigger of a partition is a clone of, or 0.

Implementations§

Source§

impl Trigger

Source

pub fn fires(&self) -> bool

True when the trigger fires with session_replication_role at origin, the default: tgenabled is O or A.

Trait Implementations§

Source§

impl Clone for Trigger

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Trigger

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Trigger

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Trigger

Source§

impl PartialEq for Trigger

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Trigger

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.