Lines Matching defs:T
106 pub struct Lock<T: ?Sized, B: Backend> {
119 pub(crate) data: UnsafeCell<T>,
123 unsafe impl<T: ?Sized + Send, B: Backend> Send for Lock<T, B> {}
127 unsafe impl<T: ?Sized + Send, B: Backend> Sync for Lock<T, B> {}
129 impl<T, B: Backend> Lock<T, B> {
132 t: impl PinInit<T>,
171 impl<T: ?Sized, B: Backend> Lock<T, B> {
174 pub fn lock(&self) -> Guard<'_, T, B> {
185 // `Option<T>` is not `#[must_use]` even if `T` is, thus the attribute is needed here.
188 pub fn try_lock(&self) -> Option<Guard<'_, T, B>> {
201 pub struct Guard<'a, T: ?Sized, B: Backend> {
202 pub(crate) lock: &'a Lock<T, B>,
208 unsafe impl<T: Sync + ?Sized, B: Backend> Sync for Guard<'_, T, B> {}
210 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> {
222 /// fn assert_held<T, B: Backend>(guard: &Guard<'_, T, B>, lock: &Lock<T, B>) {
237 pub fn lock_ref(&self) -> &'a Lock<T, B> {
254 /// The guard implements [`DerefMut`] when `T: Unpin`, so for [`Unpin`]
272 pub fn as_mut(&mut self) -> Pin<&mut T> {
278 impl<T: ?Sized, B: Backend> core::ops::Deref for Guard<'_, T, B> {
279 type Target = T;
288 impl<T: ?Sized, B: Backend> core::ops::DerefMut for Guard<'_, T, B>
290 T: Unpin,
299 impl<T: ?Sized, B: Backend> Drop for Guard<'_, T, B> {
307 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> {
314 pub unsafe fn new(lock: &'a Lock<T, B>, state: B::GuardState) -> Self {