pub struct TestObjectPerms(pub User);
Tuple Fields§
§0: User
Implementations§
Source§impl TestObjectPerms
impl TestObjectPerms
pub fn standardize(&mut self, _self_id: ObjectId)
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for TestObjectPerms
impl<'arbitrary> Arbitrary<'arbitrary> for TestObjectPerms
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moreSource§impl Clone for TestObjectPerms
impl Clone for TestObjectPerms
Source§fn clone(&self) -> TestObjectPerms
fn clone(&self) -> TestObjectPerms
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TestObjectPerms
impl Debug for TestObjectPerms
Source§impl DeepSizeOf for TestObjectPerms
impl DeepSizeOf for TestObjectPerms
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Returns an estimation of the heap-managed storage of this object.
This does not include the size of the object itself. Read more
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Returns an estimation of a total size of memory owned by the
object, including heap-managed storage. Read more
Source§impl<'de> Deserialize<'de> for TestObjectPerms
impl<'de> Deserialize<'de> for TestObjectPerms
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Object for TestObjectPerms
impl Object for TestObjectPerms
Source§type Event = TestEventPerms
type Event = TestEventPerms
Note that due to postgresql limitations reasons, this type MUST NOT include any
null byte in the serialized JSON. Trying to submit one such event will result
in the event being rejected by the server.
fn type_ulid() -> &'static TypeId
async fn can_create<'a, C: CanDoCallbacks>( &'a self, user: User, _self_id: ObjectId, _db: &'a C, ) -> Result<bool>
Source§async fn can_apply<'a, C: CanDoCallbacks>(
&'a self,
user: User,
_self_id: ObjectId,
_event: &'a Self::Event,
_db: &'a C,
) -> Result<bool>
async fn can_apply<'a, C: CanDoCallbacks>( &'a self, user: User, _self_id: ObjectId, _event: &'a Self::Event, _db: &'a C, ) -> Result<bool>
Note that permissions are always checked with the latest version of the object on the server.
So, due to this, CRDB objects are not strictly speaking a CRDT. However, it is required to do
so for security, because otherwise a user who lost permissions would still be allowed to
submit events antidated to before the permission loss, which would be bad as users could
re-grant themselves permissions.
Source§async fn users_who_can_read<'a, C: CanDoCallbacks>(
&'a self,
_db: &'a C,
) -> Result<HashSet<User>>
async fn users_who_can_read<'a, C: CanDoCallbacks>( &'a self, _db: &'a C, ) -> Result<HashSet<User>>
Note that
db.get
calls will be cached. So: Read morefn apply(&mut self, _self_id: DbPtr<Self>, event: &Self::Event)
fn required_binaries(&self) -> Vec<BinPtr>
fn snapshot_version() -> i32
Source§impl Ord for TestObjectPerms
impl Ord for TestObjectPerms
Source§fn cmp(&self, other: &TestObjectPerms) -> Ordering
fn cmp(&self, other: &TestObjectPerms) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TestObjectPerms
impl PartialEq for TestObjectPerms
Source§impl PartialOrd for TestObjectPerms
impl PartialOrd for TestObjectPerms
Source§impl Serialize for TestObjectPerms
impl Serialize for TestObjectPerms
impl Eq for TestObjectPerms
impl StructuralPartialEq for TestObjectPerms
Auto Trait Implementations§
impl Freeze for TestObjectPerms
impl RefUnwindSafe for TestObjectPerms
impl Send for TestObjectPerms
impl Sync for TestObjectPerms
impl Unpin for TestObjectPerms
impl UnwindSafe for TestObjectPerms
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