pub struct SyncEndpoints<V> { /* private fields */ }Expand description
Install in ViewSet::configure. Also replaces CRUD persistence so changes
and the sync journal commit atomically. Sync tables must already be migrated.
Implementations§
Source§impl<V> SyncEndpoints<V>
impl<V> SyncEndpoints<V>
pub fn new(viewset: V) -> Self
pub fn body_limit(self, bytes: usize) -> Self
Trait Implementations§
Source§impl<V: Clone> Clone for SyncEndpoints<V>
impl<V: Clone> Clone for SyncEndpoints<V>
Source§impl<V: SyncViewSet> MutationBackend<V> for SyncEndpoints<V>
impl<V: SyncViewSet> MutationBackend<V> for SyncEndpoints<V>
Source§fn object_permissions(&self) -> bool
fn object_permissions(&self) -> bool
Backend guarantees transactional object authorization on ordinary REST dispatch.
fn filter_read(&self, queryset: V::QuerySet) -> V::QuerySet
Source§fn rest<'a>(
&'a self,
state: &'a AppState,
principal: Option<&'a CurrentPrincipal>,
action: ViewAction,
path_id: Option<Uuid>,
headers: &'a HeaderMap,
data: Value,
) -> MutationFuture<'a, Option<Response>>
fn rest<'a>( &'a self, state: &'a AppState, principal: Option<&'a CurrentPrincipal>, action: ViewAction, path_id: Option<Uuid>, headers: &'a HeaderMap, data: Value, ) -> MutationFuture<'a, Option<Response>>
Optional conditional/idempotent handling on the ordinary CRUD routes.
fn save<'a>( &'a self, state: &'a AppState, principal: Option<&'a CurrentPrincipal>, write: ValidatedWrite<V::Model>, ) -> MutationFuture<'a, Option<V::Model>>
fn delete<'a>( &'a self, state: &'a AppState, principal: Option<&'a CurrentPrincipal>, id: Uuid, ) -> MutationFuture<'a, ()>
Source§impl<V: SyncViewSet> MutationHook<V> for SyncEndpoints<V>
impl<V: SyncViewSet> MutationHook<V> for SyncEndpoints<V>
fn id(&self) -> &'static str
fn installed( &self, state: &AppState, viewset: &V, hooks: &[Arc<dyn MutationHook<V>>], )
fn backend(&self) -> Option<&dyn MutationBackend<V>>
fn prepare_delete(&self, _model: &V::Model) -> Value
fn prepare_delete_async<'a>( &'a self, _state: &'a AppState, model: &'a V::Model, ) -> Pin<Box<dyn Future<Output = AppResult<Value>> + Send + 'a>>
fn after_delete(&self, _state: &AppState, _payload: &Value) -> AppResult<()>
fn after_commit( &self, _state: &AppState, _current: Option<&CurrentPrincipal>, _action: ViewAction, _model: &V::Model, ) -> AppResult<()>
Source§impl<V: SyncViewSet> ViewSetExtension<V> for SyncEndpoints<V>
impl<V: SyncViewSet> ViewSetExtension<V> for SyncEndpoints<V>
Auto Trait Implementations§
impl<V> !RefUnwindSafe for SyncEndpoints<V>
impl<V> !UnwindSafe for SyncEndpoints<V>
impl<V> Forget for SyncEndpoints<V>
impl<V> Freeze for SyncEndpoints<V>where
V: Freeze,
impl<V> Move for SyncEndpoints<V>
impl<V> Send for SyncEndpoints<V>where
V: Send,
impl<V> Sync for SyncEndpoints<V>where
V: Sync,
impl<V> Unpin for SyncEndpoints<V>where
V: Unpin,
impl<V> UnsafeUnpin for SyncEndpoints<V>where
V: UnsafeUnpin,
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