pub struct CedrosData { /* private fields */ }Implementations§
Source§impl CedrosData
impl CedrosData
pub async fn verify_contract( &self, request: VerifyContractRequest, ) -> Result<ContractVerificationReport>
Source§impl CedrosData
impl CedrosData
pub async fn ensure_site_exists(&self) -> Result<()>
pub async fn bootstrap_defaults(&self) -> Result<SiteBootstrapReport>
pub async fn list_default_page_entries(&self) -> Result<Vec<EntryRecord>>
pub async fn upsert_default_page_entry( &self, page_key: &str, payload: Value, ) -> Result<EntryRecord>
Source§impl CedrosData
impl CedrosData
pub async fn upsert_entry( &self, request: UpsertEntryRequest, ) -> Result<EntryRecord>
pub async fn query_entries( &self, request: QueryEntriesRequest, ) -> Result<Vec<EntryRecord>>
Source§impl CedrosData
impl CedrosData
pub async fn export_site( &self, request: ExportSiteRequest, ) -> Result<SiteExport>
pub async fn import_site( &self, request: ImportSiteRequest, ) -> Result<ImportResult>
Source§impl CedrosData
impl CedrosData
Sourcepub async fn apply_content_gating(
&self,
entries: &mut [EntryRecord],
visitor_id: &str,
record_reads: bool,
) -> Result<()>
pub async fn apply_content_gating( &self, entries: &mut [EntryRecord], visitor_id: &str, record_reads: bool, ) -> Result<()>
Applies transparent content gating to entries for a visitor.
- If metering is disabled (freeReadsPerMonth == 0), no-op.
- If
record_readsis true, records a read for each entry (deduplicated). - Strips body fields and injects
_meteringstatus when reads exhausted.
Source§impl CedrosData
impl CedrosData
Sourcepub async fn migrate(&self) -> Result<()>
pub async fn migrate(&self) -> Result<()>
Run database migrations.
ignore_missing = true so the migrator tolerates foreign entries
in _sqlx_migrations from other packages sharing the same database.
locking = false avoids acquiring a session-level pg_advisory_lock
that would leak on failure and block all subsequent migrations.
Source§impl CedrosData
impl CedrosData
pub async fn register_custom_schema( &self, request: RegisterCustomSchemaRequest, ) -> Result<CustomSchemaApplyReport>
Source§impl CedrosData
impl CedrosData
pub async fn register_site(&self, request: RegisterSiteRequest) -> Result<Site>
pub async fn register_collection( &self, request: RegisterCollectionRequest, ) -> Result<Collection>
pub async fn list_collections(&self) -> Result<Vec<Collection>>
Trait Implementations§
Source§impl Clone for CedrosData
impl Clone for CedrosData
Source§fn clone(&self) -> CedrosData
fn clone(&self) -> CedrosData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CedrosData
impl !RefUnwindSafe for CedrosData
impl Send for CedrosData
impl Sync for CedrosData
impl Unpin for CedrosData
impl UnsafeUnpin for CedrosData
impl !UnwindSafe for CedrosData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more