#[repr(C)]pub struct PdRouterContext {
pub shards: u64,
pub has_replicas: u8,
pub has_primary: u8,
pub in_transaction: u8,
pub write_override: u8,
pub query: PdStatement,
pub params: PdParameters,
}Expand description
Context on the database cluster configuration and the currently processed PostgreSQL statement.
This struct is C FFI-safe and therefore uses C types. Use public methods to interact with it instead of reading the data directly.
Fields§
§shards: u64How many shards are configured.
has_replicas: u8Does the database cluster have replicas? 1 = true, 0 = false.
has_primary: u8Does the database cluster have a primary? 1 = true, 0 = false.
in_transaction: u8Is the query being executed inside a transaction? 1 = true, 0 = false.
write_override: u8PgDog strongly believes this statement should go to a primary. 1 = true, 0 = false.
query: PdStatementpg_query generated Abstract Syntax Tree of the statement.
params: PdParametersBound parameters.
Trait Implementations§
Source§impl Clone for PdRouterContext
impl Clone for PdRouterContext
Source§fn clone(&self) -> PdRouterContext
fn clone(&self) -> PdRouterContext
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 PdRouterContext
impl Debug for PdRouterContext
Source§impl From<PdRouterContext> for Context
impl From<PdRouterContext> for Context
Source§fn from(value: PdRouterContext) -> Self
fn from(value: PdRouterContext) -> Self
Converts to this type from the input type.
impl Copy for PdRouterContext
Auto Trait Implementations§
impl Freeze for PdRouterContext
impl RefUnwindSafe for PdRouterContext
impl !Send for PdRouterContext
impl !Sync for PdRouterContext
impl Unpin for PdRouterContext
impl UnwindSafe for PdRouterContext
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