Trait cloud_filter::filter::Filter

source ·
pub trait Filter: Send + Sync {
Show 14 methods // Required method fn fetch_data( &self, _request: Request, _ticket: FetchData, _info: FetchData, ) -> impl Future<Output = CResult<()>>; // Provided methods fn cancel_fetch_data( &self, _request: Request, _info: CancelFetchData, ) -> impl Future<Output = ()> { ... } fn validate_data( &self, _request: Request, _ticket: ValidateData, _info: ValidateData, ) -> impl Future<Output = CResult<()>> { ... } fn fetch_placeholders( &self, _request: Request, _ticket: FetchPlaceholders, _info: FetchPlaceholders, ) -> impl Future<Output = CResult<()>> { ... } fn cancel_fetch_placeholders( &self, _request: Request, _info: CancelFetchPlaceholders, ) -> impl Future<Output = ()> { ... } fn opened( &self, _request: Request, _info: Opened, ) -> impl Future<Output = ()> { ... } fn closed( &self, _request: Request, _info: Closed, ) -> impl Future<Output = ()> { ... } fn dehydrate( &self, _request: Request, _ticket: Dehydrate, _info: Dehydrate, ) -> impl Future<Output = CResult<()>> { ... } fn dehydrated( &self, _request: Request, _info: Dehydrated, ) -> impl Future<Output = ()> { ... } fn delete( &self, _request: Request, _ticket: Delete, _info: Delete, ) -> impl Future<Output = CResult<()>> { ... } fn deleted( &self, _request: Request, _info: Deleted, ) -> impl Future<Output = ()> { ... } fn rename( &self, _request: Request, _ticket: Rename, _info: Rename, ) -> impl Future<Output = CResult<()>> { ... } fn renamed( &self, _request: Request, _info: Renamed, ) -> impl Future<Output = ()> { ... } fn state_changed(&self, _changes: Vec<PathBuf>) -> impl Future<Output = ()> { ... }
}
Expand description

Async core functions for implementing a Sync Engine.

Send and Sync are required as the callback could be invoked from an arbitrary thread, read here.

Required Methods§

source

fn fetch_data( &self, _request: Request, _ticket: FetchData, _info: FetchData, ) -> impl Future<Output = CResult<()>>

A placeholder hydration has been requested. This means that the placeholder should be populated with its corresponding data on the remote.

Provided Methods§

source

fn cancel_fetch_data( &self, _request: Request, _info: CancelFetchData, ) -> impl Future<Output = ()>

A placeholder hydration request has been cancelled.

source

fn validate_data( &self, _request: Request, _ticket: ValidateData, _info: ValidateData, ) -> impl Future<Output = CResult<()>>

Followed by a successful call to Filter::fetch_data, this callback should verify the integrity of the data persisted in the placeholder.

You are responsible for validating the data in the placeholder. To approve the request, use the ticket provided.

Note that this callback is only called if HydrationPolicy::ValidationRequired is specified.

source

fn fetch_placeholders( &self, _request: Request, _ticket: FetchPlaceholders, _info: FetchPlaceholders, ) -> impl Future<Output = CResult<()>>

A directory population has been requested. The behavior of this callback is dependent on the PopulationType variant specified during registration.

source

fn cancel_fetch_placeholders( &self, _request: Request, _info: CancelFetchPlaceholders, ) -> impl Future<Output = ()>

A directory population request has been cancelled.

source

fn opened(&self, _request: Request, _info: Opened) -> impl Future<Output = ()>

A placeholder file handle has been opened for read, write, and/or delete access.

source

fn closed(&self, _request: Request, _info: Closed) -> impl Future<Output = ()>

A placeholder file handle that has been previously opened with read, write, and/or delete access has been closed.

source

fn dehydrate( &self, _request: Request, _ticket: Dehydrate, _info: Dehydrate, ) -> impl Future<Output = CResult<()>>

A placeholder dehydration has been requested. This means that all of the data persisted in the file will be completely discarded.

The operating system will handle dehydrating placeholder files automatically. However, it is up to you to approve this. Use the ticket to approve the request.

source

fn dehydrated( &self, _request: Request, _info: Dehydrated, ) -> impl Future<Output = ()>

A placeholder dehydration request has been cancelled.

source

fn delete( &self, _request: Request, _ticket: Delete, _info: Delete, ) -> impl Future<Output = CResult<()>>

A placeholder file is about to be deleted.

The operating system will handle deleting placeholder files automatically. However, it is up to you to approve this. Use the ticket to approve the request.

source

fn deleted(&self, _request: Request, _info: Deleted) -> impl Future<Output = ()>

A placeholder file has been deleted.

source

fn rename( &self, _request: Request, _ticket: Rename, _info: Rename, ) -> impl Future<Output = CResult<()>>

A placeholder file is about to be renamed or moved.

The operating system will handle moving and renaming placeholder files automatically. However, it is up to you to approve this. Use the ticket to approve the request.

When the operation is completed, the Filter::renamed callback will be called.

source

fn renamed(&self, _request: Request, _info: Renamed) -> impl Future<Output = ()>

A placeholder file has been renamed or moved.

source

fn state_changed(&self, _changes: Vec<PathBuf>) -> impl Future<Output = ()>

Placeholder for changed attributes under the sync root.

This callback is implemented using ReadDirectoryChangesW so it is not provided by the Cloud Filter APIs.

This callback is used to detect when a user pins or unpins a placeholder file, etc.

See also Cloud Files API Frequently Asked Questions.

Object Safety§

This trait is not object safe.

Implementors§