[−][src]Struct pgx::spi::SpiHeapTupleData
Represents the set of pg_sys::Datum
s 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]
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]
&self,
ordinal: usize
) -> Result<&SpiHeapTupleDataEntry, SpiError>
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]
&mut self,
ordinal: usize
) -> Result<&mut SpiHeapTupleDataEntry, SpiError>
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]
&mut self,
name: &str
) -> Result<&mut SpiHeapTupleDataEntry, SpiError>
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]
&mut self,
ordinal: usize,
datum: T
) -> Result<(), SpiError>
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]
&mut self,
name: &str,
datum: T
) -> Result<(), SpiError>
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.
pub fn index(&self, index: &str) -> &Self::Output
[src]
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.
pub fn index(&self, index: usize) -> &Self::Output
[src]
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
impl RefUnwindSafe for SpiHeapTupleData
[src]
impl !Send for SpiHeapTupleData
[src]
impl !Sync for SpiHeapTupleData
[src]
impl Unpin for SpiHeapTupleData
[src]
impl UnwindSafe for SpiHeapTupleData
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,