Skip to main content

TableRef

Struct TableRef 

Source
pub struct TableRef<'a> { /* private fields */ }
Expand description

A metadata-only view of a TABLE and its optional related TABLE DATA entry.

This handle borrows metadata parsed and indexed by crate::Archive::open. Creating or querying it does not seek to or decompress table data. Schema, table, and column identities are byte-oriented.

Row representation and column-layout queries deliberately distinguish unavailable metadata, malformed COPY metadata, and unsupported table-data representations. Raw selected-entry access remains separate and may still be possible for a representation the row parser does not support.

Implementations§

Source§

impl<'a> TableRef<'a>

Source

pub fn schema(&self) -> Option<&[u8]>

Returns table namespace bytes, or None when the TABLE namespace was NULL.

Source

pub fn name(&self) -> &[u8] ⓘ

Returns exact table-name bytes.

Source

pub const fn table_entry_id(&self) -> DumpId

Returns the dump ID of the TABLE TOC entry.

Source

pub fn data_entry_id(&self) -> Option<DumpId>

Returns the dump ID of the related TABLE DATA entry, when present.

None means the metadata index found no related table-data entry.

Source

pub fn data_representation( &self, ) -> Result<TableDataRepresentation, PgDumpError>

Returns the table-data representation derived from stored TOC metadata.

CopyText, Insert, Binary, and other recognized states are values. If the representation cannot be derived because metadata is absent or malformed, this returns the corresponding typed metadata error instead.

Source

pub fn columns(&self) -> Result<&[Column], PgDumpError>

Returns COPY columns in the exact positional order used by parsed rows.

Missing table-data/COPY metadata, malformed COPY statements, and unsupported table-data representations are reported distinctly. This metadata-only call does not decompress data. Raw entry access remains available through crate::Archive::entry_reader when the selected entry itself is readable.

Source

pub fn column_index(&self, name: &[u8]) -> Result<Option<usize>, PgDumpError>

Resolves an exact byte-oriented COPY column name to its zero-based field index.

Ok(Some(index)) means valid metadata contained the name. Ok(None) means metadata was valid but the name was absent. Metadata unavailable/malformed and unsupported representations are returned as distinct typed errors.

Trait Implementations§

Source§

impl<'a> Clone for TableRef<'a>

Source§

fn clone(&self) -> TableRef<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for TableRef<'a>

Source§

impl<'a> Debug for TableRef<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TableRef<'a>

§

impl<'a> RefUnwindSafe for TableRef<'a>

§

impl<'a> Send for TableRef<'a>

§

impl<'a> Sync for TableRef<'a>

§

impl<'a> Unpin for TableRef<'a>

§

impl<'a> UnsafeUnpin for TableRef<'a>

§

impl<'a> UnwindSafe for TableRef<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.