[][src]Struct pgx::spi::SpiHeapTupleData

pub struct SpiHeapTupleData { /* fields omitted */ }

Represents the set of pg_sys::Datums in a pg_sys::HeapTuple

Implementations

impl SpiHeapTupleData[src]

pub fn new(tupdesc: TupleDesc, htup: *mut HeapTupleData) -> Self[src]

Create a new SpiHeapTupleData from its constituent parts

pub fn get_datum<T: FromDatum>(&self, ordinal: usize) -> Option<T>[src]

👎 Deprecated since 0.1.6:

Please use the by_ordinal function instead

Get a typed Datum value from this HeapTuple by its ordinal position.

The ordinal position is 1-based

pub fn by_ordinal(
    &self,
    ordinal: usize
) -> Result<&SpiHeapTupleDataEntry, SpiError>
[src]

Get a typed Datum value from this HeapTuple by its ordinal position.

The ordinal position is 1-based.

If the specified ordinal is out of bounds a Err(SpiError::Noattribute) is returned

pub fn by_name(&self, name: &str) -> Result<&SpiHeapTupleDataEntry, SpiError>[src]

Get a typed Datum value from this HeapTuple by its field name.

If the specified name does not exist a Err(SpiError::Noattribute) is returned

pub fn by_ordinal_mut(
    &mut self,
    ordinal: usize
) -> Result<&mut SpiHeapTupleDataEntry, SpiError>
[src]

Get a mutable typed Datum value from this HeapTuple by its ordinal position.

The ordinal position is 1-based.

If the specified ordinal is out of bounds a Err(SpiError::Noattribute) is returned

pub fn by_name_mut(
    &mut self,
    name: &str
) -> Result<&mut SpiHeapTupleDataEntry, SpiError>
[src]

Get a mutable typed Datum value from this HeapTuple by its field name.

If the specified name does not exist a Err(SpiError::Noattribute) is returned

pub fn set_by_ordinal<T: IntoDatum + FromDatum>(
    &mut self,
    ordinal: usize,
    datum: T
) -> Result<(), SpiError>
[src]

Set a datum value for the specified ordinal position

If the specified ordinal is out of bounds a Err(SpiError::Noattribute) is returned

pub fn set_by_name<T: IntoDatum + FromDatum>(
    &mut self,
    name: &str,
    datum: T
) -> Result<(), SpiError>
[src]

Set a datum value for the specified field name

If the specified name does not exist a Err(SpiError::Noattribute) is returned

Trait Implementations

impl Index<&'_ str> for SpiHeapTupleData[src]

Provide named indexing into a SpiHeapTupleData.

If the field name doesn't exist, it will panic

type Output = SpiHeapTupleDataEntry

The returned type after indexing.

impl Index<usize> for SpiHeapTupleData[src]

Provide ordinal indexing into a SpiHeapTupleData.

If the index is out of bounds, it will panic

type Output = SpiHeapTupleDataEntry

The returned type after indexing.

impl IndexMut<&'_ str> for SpiHeapTupleData[src]

Provide mutable named indexing into a SpiHeapTupleData.

If the field name doesn't exist, it will panic

impl IndexMut<usize> for SpiHeapTupleData[src]

Provide mutable ordinal indexing into a SpiHeapTupleData.

If the index is out of bounds, it will panic

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.