pub enum ReadWrite {
Read,
Write,
Unknown,
}
Expand description
Indicates if the statement is a read or a write. Read statements are sent to a replica, if one is configured. Write statements are sent to the primary.
§Example
use pgdog_plugin::ReadWrite;
// The statement should go to a replica.
let read = ReadWrite::Read;
// The statement should go the primary.
let write = ReadWrite::Write;
// Skip and let PgDog decide.
let unknown = ReadWrite::Unknown;
Variants§
Read
Send the statement to a replica, if any are configured.
Write
Send the statement to the primary.
Unknown
Plugin doesn’t know if the statement is a read or write. This let’s PgDog decide. Use this if you don’t want to make this decision in the plugin.
Trait Implementations§
impl Copy for ReadWrite
impl Eq for ReadWrite
impl StructuralPartialEq for ReadWrite
Auto Trait Implementations§
impl Freeze for ReadWrite
impl RefUnwindSafe for ReadWrite
impl Send for ReadWrite
impl Sync for ReadWrite
impl Unpin for ReadWrite
impl UnwindSafe for ReadWrite
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<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