Skip to main content

FfiApp

Struct FfiApp 

Source
pub struct FfiApp { /* private fields */ }

Implementations§

Source§

impl FfiApp

Source

pub fn new( data_dir: String, _keychain_group: String, _app_version: String, ) -> Arc<Self> ⓘ

Source

pub fn state(&self) -> AppState

Source

pub fn user_profile(&self, owner_pubkey_hex: String) -> UserProfileSnapshot

Lock-only, account-scoped lookup. Safe for rendering: no actor wait, database access, profile fetch, or caller-provided metadata fallback.

Source

pub fn accept_direct_files( &self, chat_id: String, transfer_id: String, destination: Arc<dyn DirectFileDestination>, )

A selected output resource is handed to the background transfer worker. Unlike ordinary UI actions it is neither serializable nor replayable.

Source

pub fn dispatch(&self, action: AppAction)

Source

pub fn perf_counters(&self) -> FfiPerfCountersSnapshot

Snapshot of the per-FFI-method call counts since FfiApp was created. Used by tests/perf_budgets.rs to assert that hot shell paths stay within their expected FFI traffic. Reading is best-effort Relaxed — call counts are advisory not transactional.

Source

pub fn core_perf_counters(&self) -> CorePerfCountersSnapshot

Snapshot of core-internal hot-loop counters. Used by tests/perf_budgets.rs to budget work that happens entirely inside the core thread — the FFI surface counters above can’t see those. Default snapshot on timeout so a wedged core can’t pin the test on a perpetual wait.

Source

pub fn search( &self, query: String, scope_chat_id: Option<String>, limit: u32, ) -> SearchResultSnapshot

Grouped Signal-style search: matches known and globally indexed people, plus the in-memory contact/group list, and runs the SQLite FTS5 index for the messages section. Optional scope_chat_id restricts message hits to a single thread (the “search in this chat” pill in the desktop sidebar). Returns an empty snapshot for empty / whitespace queries.

Source

pub fn chat_snapshot( &self, chat_id: String, limit: u32, ) -> Option<CurrentChatSnapshot>

Bounded chat projection for a route-selected chat. Unlike OpenChat, this is a direct read from the shared state/SQLite handle and never waits behind the core action queue. Shells use it as the first paint for chat screens; the core still receives OpenChat for unread clearing, subscriptions, and side effects.

Source

pub fn chat_snapshot_before( &self, chat_id: String, before_message_id: String, limit: u32, ) -> Option<CurrentChatSnapshot>

Source

pub fn chat_snapshot_around_message( &self, chat_id: String, message_id: String, before_limit: u32, after_limit: u32, ) -> Option<CurrentChatSnapshot>

Source

pub fn export_support_bundle_json(&self) -> String

Source

pub fn peer_profile_debug( &self, owner_input: String, ) -> Option<PeerProfileDebugSnapshot>

Source

pub fn mutual_groups(&self, owner_input: String) -> MutualGroupsSnapshot

Source

pub fn prepare_for_suspend(&self)

Source

pub fn shutdown(&self)

Source

pub fn shutdown_and_wait(&self)

Waits until the core and its runtime have released their resources. Hosts must call this from a background worker before terminal cleanup.

Source

pub fn listen_for_updates(&self, reconciler: Box<dyn AppReconciler>)

Trait Implementations§

Source§

impl Drop for FfiApp

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<UT> LiftRef<UT> for FfiApp

Source§

impl<UT> LowerError<UT> for FfiApp

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for FfiApp

Source§

type ReturnType = <Arc<FfiApp> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
Source§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for FfiApp

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self> ⓘ

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more