Lines Matching refs:T

35 pub struct RwLock<T> {
37 data: UnsafeCell<T>,
42 pub struct RwLockReadGuard<'a, T: 'a> {
43 data: *const T,
51 pub struct RwLockUpgradableGuard<'a, T: 'a> {
52 data: *const T,
53 inner: &'a RwLock<T>,
59 pub struct RwLockWriteGuard<'a, T: 'a> {
60 data: *mut T,
61 inner: &'a RwLock<T>,
64 unsafe impl<T: Send> Send for RwLock<T> {}
65 unsafe impl<T: Send + Sync> Sync for RwLock<T> {}
68 impl<T> RwLock<T> {
71 pub const fn new(data: T) -> Self { in new()
81 pub fn into_inner(self) -> T { in into_inner() argument
90 pub fn as_mut_ptr(&self) -> *mut T { in as_mut_ptr() argument
115 pub fn try_read(&self) -> Option<RwLockReadGuard<T>> { in try_read() argument
124 fn inner_try_read(&self) -> Option<RwLockReadGuard<T>> { in inner_try_read() argument
151 pub fn read(&self) -> RwLockReadGuard<T> { in read() argument
179 pub fn try_write(&self) -> Option<RwLockWriteGuard<T>> { in try_write() argument
191 fn inner_try_write(&self) -> Option<RwLockWriteGuard<T>> { in inner_try_write() argument
210 pub fn write(&self) -> RwLockWriteGuard<T> { in write() argument
222 pub fn try_upgradeable_read(&self) -> Option<RwLockUpgradableGuard<T>> { in try_upgradeable_read() argument
232 fn inner_try_upgradeable_read(&self) -> Option<RwLockUpgradableGuard<T>> { in inner_try_upgradeable_read() argument
248 pub fn upgradeable_read(&self) -> RwLockUpgradableGuard<T> { in upgradeable_read() argument
276 pub unsafe fn get_mut(&mut self) -> &mut T { in get_mut() argument
281 impl<T: Default> Default for RwLock<T> {
288 impl<T> From<T> for RwLock<T> {
289 fn from(data: T) -> Self { in from()
294 impl<'rwlock, T> RwLockReadGuard<'rwlock, T> {
305 pub unsafe fn leak(this: Self) -> &'rwlock T { in leak() argument
311 impl<'rwlock, T> RwLockUpgradableGuard<'rwlock, T> {
315 pub fn try_upgrade(self) -> Result<RwLockWriteGuard<'rwlock, T>, Self> { in try_upgrade() argument
341 pub fn upgrade(mut self) -> RwLockWriteGuard<'rwlock, T> { in upgrade() argument
355 pub fn downgrade(self) -> RwLockReadGuard<'rwlock, T> { in downgrade() argument
360 let inner: &RwLock<T> = self.inner; in downgrade()
381 pub unsafe fn leak(this: Self) -> &'rwlock T { in leak() argument
382 let this: ManuallyDrop<RwLockUpgradableGuard<'_, T>> = ManuallyDrop::new(this); in leak()
388 impl<'rwlock, T> RwLockWriteGuard<'rwlock, T> {
399 pub unsafe fn leak(this: Self) -> &'rwlock T { in leak() argument
408 pub fn downgrade(self) -> RwLockReadGuard<'rwlock, T> { in downgrade() argument
427 pub fn downgrade_to_upgradeable(self) -> RwLockUpgradableGuard<'rwlock, T> { in downgrade_to_upgradeable() argument
446 impl<'rwlock, T> Deref for RwLockReadGuard<'rwlock, T> {
447 type Target = T;
454 impl<'rwlock, T> Deref for RwLockUpgradableGuard<'rwlock, T> {
455 type Target = T;
462 impl<'rwlock, T> Deref for RwLockWriteGuard<'rwlock, T> {
463 type Target = T;
470 impl<'rwlock, T> DerefMut for RwLockWriteGuard<'rwlock, T> {
476 impl<'rwlock, T> Drop for RwLockReadGuard<'rwlock, T> {
484 impl<'rwlock, T> Drop for RwLockUpgradableGuard<'rwlock, T> {
496 impl<'rwlock, T> Drop for RwLockWriteGuard<'rwlock, T> {