pub trait Config:
'static
+ Send
+ Sync
+ Sealed {
// Required methods
fn check_ulids();
fn reencode_old_versions<D>(call_on: &D) -> impl Future
where D: Db;
fn create<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
created_at: EventId,
snapshot_version: i32,
object: &Value,
) -> impl Future
where D: Db;
fn recreate<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
created_at: EventId,
snapshot_version: i32,
object: &Value,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> impl Future
where D: ClientSideDb;
fn submit<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
event: &Value,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> impl Future
where D: Db;
fn remove_event<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
) -> impl Future
where D: ClientSideDb;
fn get_users_who_can_read<'a, D, C>(
call_on: &'a D,
object_id: ObjectId,
type_id: TypeId,
snapshot_version: i32,
snapshot: Value,
cb: &'a C,
) -> impl Future + 'a
where D: ServerSideDb,
C: CanDoCallbacks;
fn recreate_no_lock<'a, D, C>(
call_on: &'a D,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
updatedness: Updatedness,
cb: &'a C,
) -> impl Future + 'a
where D: ServerSideDb,
C: CanDoCallbacks;
fn upload_object<D>(
call_on: &D,
user: User,
updatedness: Updatedness,
type_id: TypeId,
object_id: ObjectId,
created_at: EventId,
snapshot_version: i32,
snapshot: Arc<Value>,
) -> impl Future
where D: ServerSideDb;
fn upload_event<D>(
call_on: &D,
user: User,
updatedness: Updatedness,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
event: Arc<Value>,
) -> impl Future
where D: ServerSideDb;
}
Required Methods§
Sourcefn check_ulids()
fn check_ulids()
Auto-generated by crdb::db!
.
Panics if there are two types with the same ULID configured
fn reencode_old_versions<D>(call_on: &D) -> impl Futurewhere
D: Db,
fn create<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
created_at: EventId,
snapshot_version: i32,
object: &Value,
) -> impl Futurewhere
D: Db,
Sourcefn recreate<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
created_at: EventId,
snapshot_version: i32,
object: &Value,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> impl Futurewhere
D: ClientSideDb,
fn recreate<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
created_at: EventId,
snapshot_version: i32,
object: &Value,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> impl Futurewhere
D: ClientSideDb,
The returned serde_json::Value is guaranteed to be a serialization of the latest snapshot of the object at the current snapshot version
Sourcefn submit<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
event: &Value,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> impl Futurewhere
D: Db,
fn submit<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
event: &Value,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> impl Futurewhere
D: Db,
The returned serde_json::Value is guaranteed to be a serialization of the latest snapshot of the object at the current snapshot version
fn remove_event<D>(
db: &D,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
) -> impl Futurewhere
D: ClientSideDb,
fn get_users_who_can_read<'a, D, C>(
call_on: &'a D,
object_id: ObjectId,
type_id: TypeId,
snapshot_version: i32,
snapshot: Value,
cb: &'a C,
) -> impl Future + 'awhere
D: ServerSideDb,
C: CanDoCallbacks,
fn recreate_no_lock<'a, D, C>(
call_on: &'a D,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
updatedness: Updatedness,
cb: &'a C,
) -> impl Future + 'awhere
D: ServerSideDb,
C: CanDoCallbacks,
fn upload_object<D>(
call_on: &D,
user: User,
updatedness: Updatedness,
type_id: TypeId,
object_id: ObjectId,
created_at: EventId,
snapshot_version: i32,
snapshot: Arc<Value>,
) -> impl Futurewhere
D: ServerSideDb,
Sourcefn upload_event<D>(
call_on: &D,
user: User,
updatedness: Updatedness,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
event: Arc<Value>,
) -> impl Futurewhere
D: ServerSideDb,
fn upload_event<D>(
call_on: &D,
user: User,
updatedness: Updatedness,
type_id: TypeId,
object_id: ObjectId,
event_id: EventId,
event: Arc<Value>,
) -> impl Futurewhere
D: ServerSideDb,
The Vec<User>
in return type is the list of users who can read the object both before and after the change. Users who gained or
lost access to object_id
are returned as part of the Vec<ReadPermsChanges>
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.