#[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: DirectoryLoadRequestOriginal store generation/request identity.
Watch
Native or explicitly polled watch events.
Fields
WatchConfigured
Result of enabling or disabling provider watch for one URI.
Fields
§
uri: FileUriExact directory URI supplied by the UI.
Mutation
Provider mutation result and optional resulting identity.
Fields
§
request: FileTreeMutationRequestOriginal mutation envelope.
Implementations§
Source§impl FileTreeWorkerResponse
Variant inspection helpers for worker responses.
impl FileTreeWorkerResponse
Variant inspection helpers for worker responses.
Sourcepub fn directory_request(&self) -> Option<&DirectoryLoadRequest>
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§
Auto Trait Implementations§
impl Freeze for FileTreeWorkerResponse
impl RefUnwindSafe for FileTreeWorkerResponse
impl Send for FileTreeWorkerResponse
impl Sync for FileTreeWorkerResponse
impl Unpin for FileTreeWorkerResponse
impl UnwindSafe for FileTreeWorkerResponse
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