Lines Matching full:owner
76 owner: *const U, field
94 /// It stores a raw pointer to the owner that is never dereferenced. It is only used to ensure
95 /// that the right owner is being used to access the protected data. If the owner is freed, the
96 /// data becomes inaccessible; if another instance of the owner is allocated *on the same
99 pub fn new<B: Backend>(owner: &Lock<U, B>, data: T) -> Self { in new()
105 owner: owner.data.get(), in new()
113 /// reference) that the owner is locked.
120 /// Panics if `owner` is different from the data protected by the lock used in
122 pub fn access<'a>(&'a self, owner: &'a U) -> &'a T in access()
128 "`U` cannot be a ZST because `owner` wouldn't be unique" in access()
130 if !ptr::eq(owner, self.owner) { in access()
134 // SAFETY: `owner` is evidence that there are only shared references to the owner for the in access()
142 /// mutable owner) that the owner is locked mutably.
147 /// Showing a mutable reference to the owner is sufficient because we know no other references
152 /// Panics if `owner` is different from the data protected by the lock used in
154 pub fn access_mut<'a>(&'a self, owner: &'a mut U) -> &'a mut T { in access_mut()
157 "`U` cannot be a ZST because `owner` wouldn't be unique" in access_mut()
159 if !ptr::eq(owner, self.owner) { in access_mut()
163 // SAFETY: `owner` is evidence that there is only one reference to the owner. in access_mut()