// file: crates/ksp-store-lib/src/lib.rs // version: 4 #![warn(missing_docs)] #![deny(unreachable_pub)] #![forbid(unsafe_code)] //! Common backend-neutral Store runtime facade for KSP. //! //! `0.3.2-pre.005` materializes the first physical PostgreSQL runtime path: //! one bounded Deadpool pool, one startup connection proof and explicit TLS //! policy. SQL migrations remain private future slices of this release. //! //! The default `postgres` feature compiles the official PostgreSQL backend as //! an optional implementation dependency. No backend implementation type is //! part of this crate's public surface. mod constants; mod error; mod settings; mod store; /// Error code reserved for operations attempted after a Store backend is closed. pub use self::error::ERROR_CODE_BACKEND_CLOSED; /// Error code used when a known Store backend is selected without its compiled feature. pub use self::error::ERROR_CODE_BACKEND_NOT_COMPILED; /// Error code used when a compiled Store backend cannot complete opening. pub use self::error::ERROR_CODE_BACKEND_OPEN_FAILED; /// Error code used when PostgreSQL physical configuration is malformed or unsupported. pub use self::error::ERROR_CODE_POSTGRES_CONFIG_INVALID; /// Error code used when PostgreSQL physical connection establishment fails. pub use self::error::ERROR_CODE_POSTGRES_CONNECT_FAILED; /// Error code used when a bounded PostgreSQL pool operation reaches its deadline. pub use self::error::ERROR_CODE_POSTGRES_POOL_TIMEOUT; /// Error code used when PostgreSQL verified TLS setup or negotiation fails. pub use self::error::ERROR_CODE_POSTGRES_TLS_FAILED; /// Error code used when Store settings violate backend-neutral bounds or invariants. pub use self::error::ERROR_CODE_SETTINGS_INVALID; /// Error code used when explicit Store shutdown exceeds its configured deadline. pub use self::error::ERROR_CODE_SHUTDOWN_TIMEOUT; /// Bounded PostgreSQL bootstrap and migration settings owned by the Store facade. pub use self::settings::PostgresBootstrapSettings; /// Bounded PostgreSQL connection-pool settings owned by the Store facade. pub use self::settings::PostgresPoolSettings; /// PostgreSQL settings owned by the Store facade without exposing backend implementation types. pub use self::settings::PostgresStoreSettings; /// TLS policy accepted by the backend-neutral PostgreSQL settings surface. pub use self::settings::PostgresTlsMode; /// Backend identity understood independently from compiled Cargo features. pub use self::settings::StoreBackendKind; /// Backend-specific settings selected through the common Store facade. pub use self::settings::StoreBackendSettings; /// Complete backend-neutral settings consumed by the common Store runtime facade. pub use self::settings::StoreSettings; /// Opaque common Store runtime facade with consuming async shutdown. pub use self::store::Store; /// Error code used when a RAW write collides with divergent content for the same logical identity. pub use ksp_store_api::ERROR_CODE_RAW_CONFLICT; /// Error code used when a RAW Store model violates one of its backend-agnostic invariants. pub use ksp_store_api::ERROR_CODE_RAW_MODEL_INVALID; /// Error code used when a KSP-owned RAW persistence payload violates its format or admission contract. pub use ksp_store_api::ERROR_CODE_RAW_PAYLOAD_INVALID; /// Error code used when acquisition provenance is malformed, unsafe or internally inconsistent. pub use ksp_store_api::ERROR_CODE_RAW_PROVENANCE_INVALID; /// Error code used when one RAW query or cursor violates backend-agnostic query invariants. pub use ksp_store_api::ERROR_CODE_RAW_QUERY_INVALID; /// Error code used when a RAW retention transition violates the logical lifecycle contract. pub use ksp_store_api::ERROR_CODE_RAW_RETENTION_INVALID; /// Common KSP error type used by Store-facing contracts. pub use ksp_store_api::Error; /// Stable structured code identifying a KSP error category and condition. pub use ksp_store_api::ErrorCode; /// Structured contextual field attached to a KSP error. pub use ksp_store_api::ErrorContext; /// Maximum complete RAW account-data length admitted by the Store API. pub use ksp_store_api::MAX_RAW_ACCOUNT_DATA_BYTES; /// Maximum UTF-8 byte length accepted for one safe logical RAW/provenance code. pub use ksp_store_api::MAX_RAW_CODE_BYTES; /// Maximum opaque query cursor length admitted by the Store API. pub use ksp_store_api::MAX_RAW_PAGE_CURSOR_BYTES; /// Maximum KSP-owned canonical RAW payload admitted by the Store API. pub use ksp_store_api::MAX_RAW_PAYLOAD_BYTES; /// Maximum source-wire payload size recorded as acquisition metadata. pub use ksp_store_api::MAX_RAW_SOURCE_PAYLOAD_BYTES; /// Maximum supported Unix millisecond timestamp. pub use ksp_store_api::MAX_RAW_UNIX_MILLIS; /// Canonical Solana account address primitive shared by persistent models. pub use ksp_store_api::Pubkey; /// Persistable acquisition observation linked to one complete canonical RAW account state. pub use ksp_store_api::RawAccountObservation; /// Read capability for persisted RAW account-state observations. pub use ksp_store_api::RawAccountObservationRead; /// Write capability for additional observations of already persisted RAW account states. pub use ksp_store_api::RawAccountObservationWrite; /// Canonical complete N1 RAW account state independent from acquisition transport. pub use ksp_store_api::RawAccountState; /// Backend-independent list query for complete canonical RAW account states. pub use ksp_store_api::RawAccountStateQuery; /// Read capability for complete canonical RAW account states. pub use ksp_store_api::RawAccountStateRead; /// Durable backend-independent identity of one canonical RAW account state. pub use ksp_store_api::RawAccountStateReference; /// Write capability for complete canonical RAW account-state acquisitions. pub use ksp_store_api::RawAccountStateWrite; /// Origin category describing why one acquisition was performed. pub use ksp_store_api::RawAcquisitionOrigin; /// Safe source-independent acquisition provenance attached to one persisted observation. pub use ksp_store_api::RawAcquisitionProvenance; /// Combined outcome of one atomic canonical RAW entity plus observation acquisition. pub use ksp_store_api::RawAcquisitionWriteOutcome; /// Fixed-size digest identifying canonical or source bytes without retaining them. pub use ksp_store_api::RawContentHash; /// Outcome for one canonical RAW entity in an idempotent persistence operation. pub use ksp_store_api::RawEntityWriteOutcome; /// Bounded identifier of one KSP-owned source-independent RAW persistence format. pub use ksp_store_api::RawFormatId; /// Bounded logical network/cluster identifier used in backend-independent Store identities. pub use ksp_store_api::RawNetworkId; /// Stable deterministic idempotence key for one persisted acquisition observation. pub use ksp_store_api::RawObservationKey; /// Outcome for one deterministic acquisition observation write. pub use ksp_store_api::RawObservationWriteOutcome; /// One deterministic page of backend-independent Store results. pub use ksp_store_api::RawPage; /// Opaque backend-owned cursor returned by one deterministic Store query. pub use ksp_store_api::RawPageCursor; /// Caller-requested page size without an arbitrary KSP policy ceiling. pub use ksp_store_api::RawPageLimit; /// Opaque-cursor page request used by backend-independent list operations. pub use ksp_store_api::RawPageRequest; /// Bounded source-independent KSP RAW persistence payload. pub use ksp_store_api::RawPayload; /// Bounded logical code used by acquisition provenance fields. pub use ksp_store_api::RawProvenanceCode; /// Logical availability state of one canonical RAW payload. pub use ksp_store_api::RawRetentionState; /// Outcome of one atomic RAW retention transition. pub use ksp_store_api::RawRetentionWriteOutcome; /// Optional inclusive Solana slot bounds for one Store query. pub use ksp_store_api::RawSlotRange; /// Deterministic traversal direction for Store list queries. pub use ksp_store_api::RawSortDirection; /// Bounded UTC timestamp represented as whole milliseconds since Unix epoch. pub use ksp_store_api::RawTimestamp; /// Canonical source-independent N1 RAW transaction persisted by Store backends. pub use ksp_store_api::RawTransaction; /// Explicit write mode for canonical RAW transaction acquisitions. pub use ksp_store_api::RawTransactionAcquisitionMode; /// Persistable acquisition observation linked to one canonical RAW transaction. pub use ksp_store_api::RawTransactionObservation; /// Read capability for persisted RAW transaction observations. pub use ksp_store_api::RawTransactionObservationRead; /// Write capability for additional observations of already persisted RAW transactions. pub use ksp_store_api::RawTransactionObservationWrite; /// Backend-independent list query for canonical RAW transactions. pub use ksp_store_api::RawTransactionQuery; /// Read capability for canonical RAW transactions. pub use ksp_store_api::RawTransactionRead; /// Durable backend-independent identity of one canonical RAW transaction. pub use ksp_store_api::RawTransactionReference; /// Read capability for canonical RAW transaction retention metadata. pub use ksp_store_api::RawTransactionRetentionRead; /// Requested compare-and-transition operation for one RAW transaction retention state. pub use ksp_store_api::RawTransactionRetentionTransition; /// Write capability for policy-authorized RAW transaction retention transitions. pub use ksp_store_api::RawTransactionRetentionWrite; /// Canonical 64-byte Solana transaction signature used by Store identities. pub use ksp_store_api::RawTransactionSignature; /// Minimal durable identity retained after a canonical RAW transaction payload is purged. pub use ksp_store_api::RawTransactionTombstone; /// Write capability for canonical RAW transaction acquisitions. pub use ksp_store_api::RawTransactionWrite; /// Common KSP result alias using [`Error`]. pub use ksp_store_api::Result; /// Boxed async operation returned by object-safe Store capability contracts. pub use ksp_store_api::StoreApiFuture; /// Crate-owned tracing target reserved for Store runtime behavior. pub(crate) use self::constants::TRACING_TARGET; // Keep the mandatory crate-owned tracing target part of the compiled scaffold // without inventing runtime logging before the first behavioral log site. const _: &str = crate::TRACING_TARGET;