Skip to main content

HostExternalStorage

Trait HostExternalStorage 

Source
pub trait HostExternalStorage<Profile, Schema>:
    Send
    + Sync
    + 'static
where Profile: HostProfile, Schema: HostExternalSchema,
{ type Payload: 'static; // Required methods fn store( stores: &Profile::ExternalStores, ) -> &HostExternalStore<Self::Payload>; fn source_equal( context: &HostExternalEquality<'_>, left: &Self::Payload, right: &Self::Payload, ) -> bool; fn source_hash( context: &HostExternalHashing<'_>, value: &Self::Payload, ) -> u64; fn inspect( context: &HostExternalInspection<'_>, value: &Self::Payload, ) -> EcoString; }
Expand description

Provider-owned storage and Gleam source semantics for one external schema.

Payloads are immutable after creation. Values that compare equal through HostExternalStorage::source_equal must return the same HostExternalStorage::source_hash. Hash collisions are allowed and are resolved through source equality. Source hashes are runtime indexes, not stable serialized values.

Required Associated Types§

Source

type Payload: 'static

Required Methods§

Source

fn store(stores: &Profile::ExternalStores) -> &HostExternalStore<Self::Payload>

Projects the typed payload store from the final profile’s external stores.

Source

fn source_equal( context: &HostExternalEquality<'_>, left: &Self::Payload, right: &Self::Payload, ) -> bool

Compares two payloads using Gleam source equality.

Source

fn source_hash(context: &HostExternalHashing<'_>, value: &Self::Payload) -> u64

Hashes a payload consistently with HostExternalStorage::source_equal.

Source

fn inspect( context: &HostExternalInspection<'_>, value: &Self::Payload, ) -> EcoString

Produces the payload’s canonical source-oriented inspection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§