pub struct AccountEngine;Expand description
Stateless semantic account planner.
Implementations§
Source§impl AccountEngine
impl AccountEngine
Sourcepub fn validate_account_id(account_id: &str) -> Result<(), SoftchatError>
pub fn validate_account_id(account_id: &str) -> Result<(), SoftchatError>
Validate one opaque non-secret account partition identifier.
§Errors
Returns SoftchatError::InvalidAccountOperation for an empty,
oversized, or non-portable identifier.
Sourcepub fn prepare_incoming(
identity: &LocalIdentity,
account_id: String,
events: Vec<SignedEvent>,
) -> Result<PreparedIncomingBatch, SoftchatError>
pub fn prepare_incoming( identity: &LocalIdentity, account_id: String, events: Vec<SignedEvent>, ) -> Result<PreparedIncomingBatch, SoftchatError>
Authenticate a bounded incoming batch and produce immutable store values.
§Errors
Returns a stable account, event, envelope, or projection error before the platform begins a transaction.
Sourcepub fn validate_ingestion_receipt(
batch: &PreparedIncomingBatch,
receipt: &IngestionReceipt,
) -> Result<(), SoftchatError>
pub fn validate_ingestion_receipt( batch: &PreparedIncomingBatch, receipt: &IngestionReceipt, ) -> Result<(), SoftchatError>
Verify that a platform transaction handled every prepared event once.
§Errors
Returns SoftchatError::InvalidPersistenceResult for the wrong
account, unknown IDs, duplicated classifications, or incomplete output.
Sourcepub fn prepare_rumor_operation(
identity: &LocalIdentity,
account_id: String,
operation_id: String,
rumor: RumorEvent,
recipients: Vec<String>,
notification_recipients: Vec<String>,
relay_urls: Vec<String>,
kind: Nip59EnvelopeKind,
now: i64,
) -> Result<PreparedOutgoingOperation, SoftchatError>
pub fn prepare_rumor_operation( identity: &LocalIdentity, account_id: String, operation_id: String, rumor: RumorEvent, recipients: Vec<String>, notification_recipients: Vec<String>, relay_urls: Vec<String>, kind: Nip59EnvelopeKind, now: i64, ) -> Result<PreparedOutgoingOperation, SoftchatError>
Create independently randomized NIP-59 copies and required relay intents.
The returned operation must be committed before any frame is sent.
§Errors
Returns a stable operation, relay URL, recipient, or envelope error.
Sourcepub fn prepare_signed_operation(
account_id: String,
operation_id: String,
events: Vec<SignedEvent>,
relay_urls: Vec<String>,
) -> Result<PreparedOutgoingOperation, SoftchatError>
pub fn prepare_signed_operation( account_id: String, operation_id: String, events: Vec<SignedEvent>, relay_urls: Vec<String>, ) -> Result<PreparedOutgoingOperation, SoftchatError>
Persist one or more already signed direct events as an outgoing operation.
§Errors
Returns a stable operation or relay URL error.
Trait Implementations§
Source§impl Clone for AccountEngine
impl Clone for AccountEngine
Source§fn clone(&self) -> AccountEngine
fn clone(&self) -> AccountEngine
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccountEngine
impl Debug for AccountEngine
Source§impl Default for AccountEngine
impl Default for AccountEngine
Source§fn default() -> AccountEngine
fn default() -> AccountEngine
impl Copy for AccountEngine
Auto Trait Implementations§
impl Freeze for AccountEngine
impl RefUnwindSafe for AccountEngine
impl Send for AccountEngine
impl Sync for AccountEngine
impl Unpin for AccountEngine
impl UnsafeUnpin for AccountEngine
impl UnwindSafe for AccountEngine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more