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<ReplicaIdentity>
pub fn from_byte(byte: u8) -> Option<ReplicaIdentity>
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<ReplicaIdentity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ReplicaIdentity, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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