Lines Matching full:owner
79 owner: *const U, field
97 /// It stores a raw pointer to the owner that is never dereferenced. It is only used to ensure
98 /// that the right owner is being used to access the protected data. If the owner is freed, the
99 /// data becomes inaccessible; if another instance of the owner is allocated *on the same
102 pub fn new<B: Backend>(owner: &Lock<U, B>, data: T) -> Self { in new()
108 owner: owner.data.get(), in new()
116 /// reference) that the owner is locked.
123 /// Panics if `owner` is different from the data protected by the lock used in
125 pub fn access<'a>(&'a self, owner: &'a U) -> &'a T in access()
131 "`U` cannot be a ZST because `owner` wouldn't be unique" in access()
133 if !ptr::eq(owner, self.owner) { in access()
137 // SAFETY: `owner` is evidence that there are only shared references to the owner for the in access()
145 /// mutable owner) that the owner is locked mutably.
150 /// Showing a mutable reference to the owner is sufficient because we know no other references
155 /// Panics if `owner` is different from the data protected by the lock used in
157 pub fn access_mut<'a>(&'a self, owner: &'a mut U) -> &'a mut T { in access_mut()
160 "`U` cannot be a ZST because `owner` wouldn't be unique" in access_mut()
162 if !ptr::eq(owner, self.owner) { in access_mut()
166 // SAFETY: `owner` is evidence that there is only one reference to the owner. in access_mut()