pub enum ReplicaIdentity {
Default,
Nothing,
Full,
Index,
}Expand description
PostgreSQL replica identity settings
Variants§
Default
Default replica identity (primary key)
Nothing
No replica identity
Full
Full replica identity (all columns)
Index
Index-based replica identity
Implementations§
Source§impl ReplicaIdentity
impl ReplicaIdentity
Sourcepub fn from_byte(byte: u8) -> Option<Self>
pub fn from_byte(byte: u8) -> Option<Self>
Create replica identity from byte
Converts a PostgreSQL replica identity byte code to the enum variant.
§Arguments
byte- Single byte representing replica identity (‘d’, ‘n’, ‘f’, or ‘i’)
§Returns
Some(ReplicaIdentity)if the byte is validNoneif the byte is unrecognized
§Example
use pg_walstream::ReplicaIdentity;
assert_eq!(ReplicaIdentity::from_byte(b'd'), Some(ReplicaIdentity::Default));
assert_eq!(ReplicaIdentity::from_byte(b'f'), Some(ReplicaIdentity::Full));
assert_eq!(ReplicaIdentity::from_byte(b'x'), None);Sourcepub fn to_byte(&self) -> u8
pub fn to_byte(&self) -> u8
Convert to byte representation
Converts the replica identity enum to PostgreSQL’s single-byte format.
§Returns
Single byte representing the replica identity:
b'd'- Default (primary key)b'n'- Nothing (no replica identity)b'f'- Full (all columns)b'i'- Index (specific index)
§Example
use pg_walstream::ReplicaIdentity;
assert_eq!(ReplicaIdentity::Default.to_byte(), b'd');
assert_eq!(ReplicaIdentity::Full.to_byte(), b'f');Trait Implementations§
Source§impl Clone for ReplicaIdentity
impl Clone for ReplicaIdentity
Source§fn clone(&self) -> ReplicaIdentity
fn clone(&self) -> ReplicaIdentity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReplicaIdentity
impl Debug for ReplicaIdentity
Source§impl<'de> Deserialize<'de> for ReplicaIdentity
impl<'de> Deserialize<'de> for ReplicaIdentity
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
Source§impl PartialEq for ReplicaIdentity
impl PartialEq for ReplicaIdentity
Source§impl Serialize for ReplicaIdentity
impl Serialize for ReplicaIdentity
impl Eq for ReplicaIdentity
impl StructuralPartialEq for ReplicaIdentity
Auto Trait Implementations§
impl Freeze for ReplicaIdentity
impl RefUnwindSafe for ReplicaIdentity
impl Send for ReplicaIdentity
impl Sync for ReplicaIdentity
impl Unpin for ReplicaIdentity
impl UnwindSafe for ReplicaIdentity
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