pub struct AppStateProcessor {
pub backend: Arc<dyn Backend>,
pub runtime: Arc<dyn Runtime>,
/* private fields */
}Fields§
§backend: Arc<dyn Backend>§runtime: Arc<dyn Runtime>Implementations§
Source§impl AppStateProcessor
impl AppStateProcessor
pub fn new( backend: Arc<dyn Backend>, runtime: Arc<dyn Runtime>, ) -> AppStateProcessor
pub async fn get_app_state_key( &self, key_id: &[u8], ) -> Result<Arc<ExpandedAppStateKeys>, AppStateSyncError>
Sourcepub async fn clear_key_cache(&self)
pub async fn clear_key_cache(&self)
Clear the in-memory key cache (e.g. on reconnect). Keys will be re-fetched from the database backend on next access.
pub async fn decode_patch_list<FDownload>( &self, stanza_root: &Node, download: FDownload, validate_macs: bool, ) -> Result<(Vec<Mutation>, HashState, PatchList), Error>
Sourcepub async fn decode_multi_patch_list<FDownload>(
&self,
stanza_root: &Node,
download: &FDownload,
validate_macs: bool,
) -> Result<Vec<(Vec<Mutation>, HashState, PatchList)>, Error>
pub async fn decode_multi_patch_list<FDownload>( &self, stanza_root: &Node, download: &FDownload, validate_macs: bool, ) -> Result<Vec<(Vec<Mutation>, HashState, PatchList)>, Error>
Decode a multi-collection IQ response into per-collection results. Each collection is parsed and processed independently.
pub async fn process_patch_list( &self, pl: PatchList, validate_macs: bool, ) -> Result<(Vec<Mutation>, HashState, PatchList), Error>
Sourcepub async fn build_patch(
&self,
collection_name: &str,
mutations: Vec<(SyncdMutation, Vec<u8>)>,
) -> Result<(Vec<u8>, u64), Error>
pub async fn build_patch( &self, collection_name: &str, mutations: Vec<(SyncdMutation, Vec<u8>)>, ) -> Result<(Vec<u8>, u64), Error>
Build and encode a SyncdPatch for sending mutations to the server.
Takes a list of pre-encoded mutations (from encode_record) and produces
the protobuf-encoded patch bytes ready for inclusion in an IQ stanza.
§Returns
A tuple of (patch_bytes, updated_hash_state). Encode mutations into a SyncdPatch protobuf blob.
Returns (patch_bytes, base_version) where base_version is the collection
version before the patch (for the IQ version attribute). Does NOT persist
state — the caller must only persist after the server acknowledges the patch.
pub async fn get_missing_key_ids( &self, pl: &PatchList, ) -> Result<Vec<Vec<u8>>, Error>
pub async fn sync_collection<D, FDownload>(
&self,
driver: &D,
name: WAPatchName,
validate_macs: bool,
download: FDownload,
) -> Result<Vec<Mutation>, Error>where
D: AppStateSyncDriver + Sync,
FDownload: Fn(&ExternalBlobReference) -> Result<Vec<u8>, Error> + Send + Sync,
Trait Implementations§
Source§impl Clone for AppStateProcessor
impl Clone for AppStateProcessor
Source§fn clone(&self) -> AppStateProcessor
fn clone(&self) -> AppStateProcessor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AppStateProcessor
impl !RefUnwindSafe for AppStateProcessor
impl Send for AppStateProcessor
impl Sync for AppStateProcessor
impl Unpin for AppStateProcessor
impl UnsafeUnpin for AppStateProcessor
impl !UnwindSafe for AppStateProcessor
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more