Skip to main content

CsvPort

Struct CsvPort 

Source
pub struct CsvPort { /* private fields */ }
Expand description

One CSV directory as a database.

Implementations§

Source§

impl CsvPort

Source

pub fn new() -> Self

Creates an unattached driver.

Trait Implementations§

Source§

impl Debug for CsvPort

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for CsvPort

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl StoragePort for CsvPort

Source§

fn source_format(&self) -> Option<DatabaseFormat>

The driver’s fixed family (M23): the inventory reports it so a composed binary can advertise the CSV driver offline.

Source§

fn capabilities(&self) -> DriverCapabilities

The honest set (phase 30, M18): table/row/file creation served with one atomic rewrite per call; no schema alteration, no passwords, no engine-assigned AutoNumbers, and none of the Jet-style inventories.

Source§

fn write_row_ops( &mut self, table: &str, ops: &[RowWriteOp], ) -> Result<(), PortError>

One read-modify-write per batch: every operation applies to the in-memory row set and the file is rewritten once — the batch is atomic (ADR-7 atomic_batch).

Source§

fn driver_id(&self) -> DriverId

Stable identity of this driver (phase 30, item M17; ADR-7). Required (M22): a driver names itself — there is no default identity, so a driver that forgets its declaration does not compile instead of hiding behind "generic".
Source§

fn open( &mut self, path: &Path, _password: Option<&str>, ) -> Result<OpenedDatabase, PortError>

Opens the database at path; password is None for unprotected files (step 16.2, M5). Backends without passwords ignore it.
Source§

fn close(&mut self)

Closes the open database (idempotent).
Source§

fn create_database( &mut self, path: &Path, format: DatabaseFormat, ) -> Result<(), PortError>

Creates a new, empty database file at path (phase 29, item H44). The file must not exist yet; creating never opens the database — the caller dispatches StoragePort::open afterwards. Backends that cannot create files answer a precise Unsupported (the default).
Source§

fn tables(&self) -> Vec<TableDef>

Catalog of table definitions in storage order.
Source§

fn create_table(&mut self, definition: &TableDef) -> Result<(), PortError>

Creates a table; errors on duplicate names.
Source§

fn drop_table(&mut self, name: &str) -> Result<String, PortError>

Drops a table; returns its canonical name.
Source§

fn read_rows( &self, table: &str, range: RowRange, ) -> Result<Vec<Vec<FieldValue>>, PortError>

Reads a window of rows as domain values. A window starting at row_count is empty; anything beyond fails with PortError::OutOfRange.
Source§

fn insert_row( &mut self, table: &str, values: &[FieldValue], ) -> Result<(), PortError>

Appends one row (positional values, arity must match the table). Null on an AutoNumber field means “engine-assigned”.
Source§

fn update_row( &mut self, table: &str, row: usize, values: &[FieldValue], ) -> Result<(), PortError>

Replaces the row at row (zero-based live-row index) with values (step 11.10, H40). AutoNumber values are preserved by the caller.
Source§

fn delete_row(&mut self, table: &str, row: usize) -> Result<(), PortError>

Deletes the row at row (zero-based live-row index).
Source§

fn relationships(&self) -> Result<Vec<Relationship>, PortError>

Referential relationships of the open database.
Source§

fn driver_inventory(&self) -> Vec<DriverInfo>

The driver inventory of this composition (M23): every driver it can open with id, fixed family and offline capability summary. The default is empty — a single-purpose port names itself via StoragePort::driver_id; the detecting composite reports its full registry so agents can pre-flight an open.
Source§

fn save_as( &mut self, path: &Path, password: Option<&str>, ) -> Result<(), PortError>

Writes a copy of the open database to path (step 27.2, item M14). password protects the copy; None writes an unencrypted copy. The original stays untouched. Backends without a password surface answer a precise Unsupported (the default).
Source§

fn change_password( &mut self, new_password: Option<&str>, ) -> Result<(), PortError>

Replaces the open database’s password in place (step 27.2, item M14); None removes the protection. Backends without a password surface answer a precise Unsupported (the default).
Source§

fn native_views(&self) -> Result<Vec<NativeView>, PortError>

Views that live in the opened file itself (phase 73, step 73.1; item M90) — read-only, never DataCraft’s design layer. The default is empty: Jet/ACE and CSV carry none.
Source§

fn indexes(&self) -> Result<Vec<SourceIndex>, PortError>

Indexes that live in the opened file itself (phase 73, step 73.2; item M90) — read-only inventory. The default is empty.
Source§

fn triggers(&self) -> Result<Vec<SourceTrigger>, PortError>

Triggers that live in the opened file itself (phase 73, step 73.2; item M90) — inventory only, never created or executed. The default is empty.
Source§

fn source_facts(&self) -> SourceFacts

Driver facts and the file’s own health verdict (phase 73, step 73.3; item M91). Read at open: the check is bounded and runs once. The default reports no facts and a healthy file.
Source§

fn native_objects(&self) -> Result<Vec<NativeObject>, PortError>

Native Access forms/reports named by the catalog (phase 74, step 74.1; item M87) — read-only inventory, definitions never decoded. The default is empty.
Source§

fn restore_row( &mut self, table: &str, values: &[FieldValue], ) -> Result<(), PortError>

Appends a row image verbatim, including engine-assigned AutoNumber values (step 28.1, item U14 — undo/redo restoration). The default delegates to StoragePort::insert_row; backends that reject user-supplied AutoNumbers override it with a validated restore path.
Source§

fn alter_table( &mut self, table: &str, change: SchemaChange, ) -> Result<(), PortError>

Alters one table’s schema (step 24.3, item M9). Backends that cannot rewrite their catalog answer a precise Unsupported.
Source§

fn rename_table( &mut self, table: &str, new_name: &str, ) -> Result<String, PortError>

Renames one table in place (phase 72, item M81); rows, indexes and relationships follow the name. Gated on alter_table by the dispatcher; backends that cannot rewrite their catalog answer a precise Unsupported (the default).
Source§

fn supports_native_views(&self) -> bool

Whether the backend can apply sidecar views natively (step 71.3, item M93): SQLite compiles them to CREATE VIEW, while Jet/ACE/CSV rely on the shadow SQL engine and answer false.
Source§

fn create_native_view(&mut self, name: &str, sql: &str) -> Result<(), PortError>

Creates one native view in the open database (step 71.3, M93). Backends without a view engine answer a precise Unsupported.
Source§

fn drop_native_view(&mut self, name: &str) -> Result<(), PortError>

Drops one native view (step 71.3, M93).
Source§

fn create_relationship( &mut self, relationship: &Relationship, ) -> Result<(), PortError>

Creates one referential relationship (step 32.3, item M16). Backends without a relationship write path answer a precise Unsupported (the default).
Source§

fn delete_relationship( &mut self, relationship: &Relationship, ) -> Result<(), PortError>

Deletes one referential relationship (step 32.3, item M16).
Source§

fn native_queries(&self) -> Result<Vec<NativeQuery>, PortError>

Native saved queries of the open database (step 15.3, M3). Backends without native queries return an empty list.
Source§

fn macros(&self) -> Result<Vec<MacroDef>, PortError>

Named macros of the open database (step 17.1, L4). Backends without macros return an empty list; definitions are read-only.
Source§

fn vba_project(&self) -> Result<Option<VbaProject>, PortError>

Extracted VBA project of the open database (step 17.2, L5). Backends without a decoded project return None; extraction errors are reported so the core can surface them without blocking the open.

Auto Trait Implementations§

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> 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, 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, !>

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.