pub enum SecretKey {
I32(i32),
Bytes(Bytes),
}Expand description
The secret key for canceling query
There is a minor protocol change for this key. It was i32 in Protocol 3.0 but due to the limitation of a short key, in Protocol 3.2 this key is extended to bytes with a max length of 256.
Variants§
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn as_i32(&self) -> Option<i32>
pub fn as_i32(&self) -> Option<i32>
Try to coerce the key as a i32 value
Return None if the bytes is longer than 32 bits.
pub fn encode(&self, buf: &mut BytesMut) -> PgWireResult<()>
pub fn decode( buf: &mut BytesMut, data_len: usize, ctx: &DecodeContext, ) -> PgWireResult<Self>
Trait Implementations§
impl Eq for SecretKey
impl StructuralPartialEq for SecretKey
Auto Trait Implementations§
impl !Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
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