Enum FileTreeWorkerResponse

Source
#[non_exhaustive]
pub enum FileTreeWorkerResponse { Directory { request: DirectoryLoadRequest, result: Result<Vec<(FileEntry, Option<FileIdentity>)>, FileError>, }, Watch { events: Result<Vec<WatchEvent>, FileError>, }, WatchConfigured { uri: FileUri, enabled: bool, result: Result<(), FileError>, }, Mutation { request: FileTreeMutationRequest, result: Result<Option<FileIdentity>, FileError>, }, }
Expand description

One provider result delivered from the worker to the UI thread.

Directory and mutation responses retain their request envelope so stale generations and reserved IDs can be resolved deterministically.

§Examples

use ailloli_ui_fs_runtime::FileTreeWorkerResponse;
let response = FileTreeWorkerResponse::Watch { events: Ok(Vec::new()) };
assert!(response.directory_request().is_none());

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Directory

Directory entries and best-effort identities for one load request.

Fields

§request: DirectoryLoadRequest

Original store generation/request identity.

§result: Result<Vec<(FileEntry, Option<FileIdentity>)>, FileError>

Provider result; each identity may be absent or fail independently.

§

Watch

Native or explicitly polled watch events.

Fields

§events: Result<Vec<WatchEvent>, FileError>

Ordered events, an empty successful batch, or one provider error.

§

WatchConfigured

Result of enabling or disabling provider watch for one URI.

Fields

§uri: FileUri

Exact directory URI supplied by the UI.

§enabled: bool

true for watch and false for unwatch.

§result: Result<(), FileError>

Provider acknowledgement or typed error.

§

Mutation

Provider mutation result and optional resulting identity.

Fields

§request: FileTreeMutationRequest

Original mutation envelope.

§result: Result<Option<FileIdentity>, FileError>

Attested identity, None when unavailable/removing, or an error.

Implementations§

Source§

impl FileTreeWorkerResponse

Variant inspection helpers for worker responses.

Source

pub fn directory_request(&self) -> Option<&DirectoryLoadRequest>

Returns the directory request only for Self::Directory.

§Examples
use ailloli_ui_fs_runtime::FileTreeWorkerResponse;
let response = FileTreeWorkerResponse::Watch { events: Ok(Vec::new()) };
assert_eq!(response.directory_request(), None);

Trait Implementations§

Source§

impl Debug for FileTreeWorkerResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> ErasedDestructor for T
where T: 'static,