| /linux/rust/kernel/num/ |
| H A D | bounded.rs | 41 /// Returns `true` if `value` can be represented with at most `N` bits in a `T`. 43 fn fits_within<T: Integer>(value: T, num_bits: u32) -> bool { in fits_within() 44 fits_within!(value, T, num_bits) in fits_within() 57 /// - `N` is less than or equal to `T::BITS`. 241 pub struct Bounded<T: Integer, const N: u32>(T); 300 impl<T, const N: u32> Bounded<T, N> in __new() 302 T in __new() 42 fits_within<T: Integer>(value: T, num_bits: u32) -> bool fits_within() argument 399 get(self) -> T get() argument 417 extend<const M: u32>(self) -> Bounded<T, M> extend() argument 446 try_shrink<const M: u32>(self) -> Option<Bounded<T, M>> try_shrink() argument 497 shr<const SHIFT: u32, const RES: u32>(self) -> Bounded<T, RES> shr() argument 528 shr_exact<const SHIFT: u32, const RES: u32>(self) -> Option<Bounded<T, RES>> shr_exact() argument 550 shl<const SHIFT: u32, const RES: u32>(self) -> Bounded<T, RES> shl() argument 596 try_into_bounded(self) -> Option<Bounded<T, N>> try_into_bounded() argument 605 try_into_bounded(self) -> Option<Bounded<T, N>> try_into_bounded() argument 677 add(self, rhs: Bounded<T, M>) -> Self::Output add() argument 689 bitand(self, rhs: Bounded<T, M>) -> Self::Output bitand() argument 701 bitor(self, rhs: Bounded<T, M>) -> Self::Output bitor() argument 713 bitxor(self, rhs: Bounded<T, M>) -> Self::Output bitxor() argument 725 div(self, rhs: Bounded<T, M>) -> Self::Output div() argument 737 mul(self, rhs: Bounded<T, M>) -> Self::Output mul() argument 749 rem(self, rhs: Bounded<T, M>) -> Self::Output rem() argument 761 sub(self, rhs: Bounded<T, M>) -> Self::Output sub() argument 987 impl<T> AtLeastXBits<32> for T where T: AtLeastXBits<64> {} global() implementation 997 impl<T> AtLeastXBits<16> for T where T: AtLeastXBits<32> {} global() implementation 1005 impl<T> AtLeastXBits<8> for T where T: AtLeastXBits<16> {} global() implementation 1061 impl<T> FitsInXBits<16> for T where T: FitsInXBits<8> {} global() implementation 1066 impl<T> FitsInXBits<32> for T where T: FitsInXBits<16> {} global() implementation 1074 impl<T> FitsInXBits<64> for T where T: FitsInXBits<32> {} global() implementation 1128 from(value: Bounded<T, 1>) -> Self from() argument [all...] |
| /linux/tools/debugging/ |
| H A D | kernel-chktaint | 48 T=$taint 55 if [ `expr $T % 2` -eq 0 ]; then 62 T=`expr $T / 2` 63 if [ `expr $T % 2` -eq 0 ]; then 70 T=`expr $T / 2` 71 if [ `expr $T % 2` -eq 0 ]; then 78 T=`expr $T / [all...] |
| /linux/drivers/net/wireguard/selftest/ |
| H A D | counter.c | 24 #define T(n, v) do { \ in wg_packet_counter_selftest() macro 34 /* 1 */ T(0, true); in wg_packet_counter_selftest() 35 /* 2 */ T(1, true); in wg_packet_counter_selftest() 36 /* 3 */ T(1, false); in wg_packet_counter_selftest() 37 /* 4 */ T(9, true); in wg_packet_counter_selftest() 38 /* 5 */ T(8, true); in wg_packet_counter_selftest() 39 /* 6 */ T(7, true); in wg_packet_counter_selftest() 40 /* 7 */ T(7, false); in wg_packet_counter_selftest() 41 /* 8 */ T(T_LIM, true); in wg_packet_counter_selftest() 42 /* 9 */ T(T_LIM - 1, true); in wg_packet_counter_selftest() [all …]
|
| /linux/rust/zerocopy/src/ |
| H A D | wrappers.rs | 18 /// An `Unalign` wraps a `T`, removing any alignment requirement. `Unalign<T>` 19 /// has the same size and bit validity as `T`, but not necessarily the same 24 /// Since `Unalign` has no alignment requirement, the inner `T` may not be 25 /// properly aligned in memory. There are five ways to access the inner `T`: 29 /// fail if the `Unalign` does not satisfy `T`'s alignment requirement at 33 /// the `Unalign` satisfies `T`'s alignment requirement 34 /// - (where `T: Unaligned`) infallibly by reference, using [`Deref::deref`] or 101 /// `Unalign<T>` is guaranteed to have the same size and bit validity as `T`, 166 clone(&self) -> Unalign<T> clone() argument 174 new(val: T) -> Unalign<T> new() argument 180 into_inner(self) -> T into_inner() argument 202 try_deref(&self) -> Result<&T, AlignmentError<&Self, T>> try_deref() argument 222 try_deref_mut(&mut self) -> Result<&mut T, AlignmentError<&mut Self, T>> try_deref_mut() argument 239 deref_unchecked(&self) -> &T deref_unchecked() argument 262 deref_mut_unchecked(&mut self) -> &mut T deref_mut_unchecked() argument 292 get_ptr(&self) -> *const T get_ptr() argument 312 get_mut_ptr(&mut self) -> *mut T get_mut_ptr() argument 319 set(&mut self, t: T) set() argument 401 get(&self) -> T get() argument 411 deref(&self) -> &T deref() argument 418 deref_mut(&mut self) -> &mut T deref_mut() argument 628 new(t: T) -> ReadOnly<T> new() argument 635 into_inner(r: ReadOnly<T>) -> T into_inner() argument 642 as_mut(r: &mut ReadOnly<T>) -> &mut T as_mut() argument 652 as_ref_unchecked(r: &ReadOnly<T>) -> &T as_ref_unchecked() argument 701 impl<T: ?Sized> SizeEq<ReadOnly<T>> for T { global() implementation 716 unsafe impl<T: ?Sized> TransmuteFrom<ReadOnly<T>, Valid, Valid> for T {} global() implementation 720 from(t: &'a T) -> &'a ReadOnly<T> from() argument [all...] |
| H A D | ref.rs | 26 /// A `Ref<B, T>` is a reference to a `T` which is stored in a byte slice, `B`. 27 /// Unlike a native reference (`&T` or `&mut T`), `Ref<B, T>` has the same 62 pub struct Ref<B, T: ?Sized> { 65 // aligned to `T`'s alignment, and its size is valid for `T`. 66 // - If `T: KnownLayout`, let `metadata` be 67 // `T 82 new_unchecked(bytes: B) -> Ref<B, T> new_unchecked() argument 183 clone(&self) -> Ref<B, T> clone() argument 210 sized_from(bytes: B) -> Result<Ref<B, T>, CastError<B, T>> sized_from() argument 228 sized_from_prefix(bytes: B) -> Result<(Ref<B, T>, B), CastError<B, T>> sized_from_prefix() argument 249 sized_from_suffix(bytes: B) -> Result<(B, Ref<B, T>), CastError<B, T>> sized_from_suffix() argument 311 from_bytes(source: B) -> Result<Ref<B, T>, CastError<B, T>> from_bytes() argument 365 from_prefix(source: B) -> Result<(Ref<B, T>, B), CastError<B, T>> from_prefix() argument 430 from_suffix(source: B) -> Result<(B, Ref<B, T>), CastError<B, T>> from_suffix() argument 491 from_bytes_with_elems(source: B, count: usize) -> Result<Ref<B, T>, CastError<B, T>> from_bytes_with_elems() argument 545 from_prefix_with_elems( source: B, count: usize, ) -> Result<(Ref<B, T>, B), CastError<B, T>> from_prefix_with_elems() argument 591 from_suffix_with_elems( source: B, count: usize, ) -> Result<(B, Ref<B, T>), CastError<B, T>> from_suffix_with_elems() argument 623 into_ref(r: Self) -> &'a T into_ref() argument 671 into_mut(r: Self) -> &'a mut T into_mut() argument 760 read(r: &Self) -> T read() argument 784 write(r: &mut Self, t: T) write() argument 805 deref(&self) -> &T deref() argument 847 deref_mut(&mut self) -> &mut T deref_mut() argument 960 cast_for_sized<'a, T, A, R, S>( ptr: Ptr<'a, [u8], (A, Aligned, Valid)>, ) -> Ptr<'a, T, (A, Unaligned, Valid)> where T: FromBytes + KnownLayout + ?Sized, A: crate::invariant::Aliasing, [u8]: MutationCompatible<T, A, Initialized, Initialized, R>, T: TransmuteFromPtr<T, A, Initialized, Valid, crate::pointer::cast::IdCast, S>, cast_for_sized() argument 966 cast_for_sized<'a, T, A, R, S>( ptr: Ptr<'a, [u8], (A, Aligned, Valid)>, ) -> Ptr<'a, T, (A, Unaligned, Valid)> where T: FromBytes + KnownLayout + ?Sized, A: crate::invariant::Aliasing, [u8]: MutationCompatible<T, A, Initialized, Initialized, R>, T: TransmuteFromPtr<T, A, Initialized, Valid, crate::pointer::cast::IdCast, S>, cast_for_sized() argument 967 cast_for_sized<'a, T, A, R, S>( ptr: Ptr<'a, [u8], (A, Aligned, Valid)>, ) -> Ptr<'a, T, (A, Unaligned, Valid)> where T: FromBytes + KnownLayout + ?Sized, A: crate::invariant::Aliasing, [u8]: MutationCompatible<T, A, Initialized, Initialized, R>, T: TransmuteFromPtr<T, A, Initialized, Valid, crate::pointer::cast::IdCast, S>, cast_for_sized() argument 979 project(src: PtrInner<'_, [u8]>) -> *mut T cast_for_sized() argument [all...] |
| /linux/rust/pin-init/src/ |
| H A D | lib.rs | 45 //! - a memory location that can hold your `struct` (this can be the [stack], an [`Arc<T>`], 46 //! [`Box<T>`] or any other smart pointer that supports this library). 131 //! To declare an init macro/function you just return an [`impl PinInit<T, E>`]: 159 //! [`impl PinInit<T, E>`] directly from a closure. Of course you have to ensure that the closure 163 //! `slot` now contains a valid bit pattern for the type `T`, 251 doc = "[`Arc<T>`]: https://rust.docs.kernel.org/kernel/sync/struct.Arc.html" 255 doc = "[`Box<T>`]: https://rust.docs.kernel.org/kernel/alloc/kbox/struct.Box.html" 257 #![cfg_attr(not(kernel), doc = "[`Arc<T>`]: alloc::alloc::sync::Arc")] 258 #![cfg_attr(not(kernel), doc = "[`Box<T>`]: alloc::alloc::boxed::Box")] 260 //! [`impl PinInit<T, 953 pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E> where F: FnOnce(Pin<&mut T>) -> Result<(), E>, pin_chain() argument 969 raw_init<T>(slot: *mut T, init: impl PinInit<T>) raw_init() argument 984 raw_try_init<T, E>(slot: *mut T, init: impl PinInit<T, E>) -> Result<(), E> raw_try_init() argument 1068 chain<F>(self, f: F) -> ChainInit<Self, F, T, E> where F: FnOnce(&mut T) -> Result<(), E>, chain() argument 1147 pin_init_from_closure<T: ?Sized, E>( f: impl FnOnce(*mut T) -> Result<(), E>, ) -> impl PinInit<T, E> pin_init_from_closure() argument 1166 init_from_closure<T: ?Sized, E>( f: impl FnOnce(*mut T) -> Result<(), E>, ) -> impl Init<T, E> init_from_closure() argument 1177 cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl PinInit<U, E> cast_pin_init() argument 1190 cast_init<T, U, E>(init: impl Init<T, E>) -> impl Init<U, E> cast_init() argument 1200 uninit<T, E>() -> impl Init<MaybeUninit<T>, E> uninit() argument 1287 init_array_from_fn<I, const N: usize, T, E>( make_init: impl FnMut(usize) -> I, ) -> impl Init<[T; N], E> where I: Init<T, E>, init_array_from_fn() argument 1291 init_array_from_fn<I, const N: usize, T, E>( make_init: impl FnMut(usize) -> I, ) -> impl Init<[T; N], E> where I: Init<T, E>, global() argument 1312 pin_init_array_from_fn<I, const N: usize, T, E>( make_init: impl FnMut(usize) -> I, ) -> impl PinInit<[T; N], E> where I: PinInit<T, E>, pin_init_array_from_fn() argument 1316 pin_init_array_from_fn<I, const N: usize, T, E>( make_init: impl FnMut(usize) -> I, ) -> impl PinInit<[T; N], E> where I: PinInit<T, E>, global() argument 1348 pin_init_scope<T, E, F, I>(make_init: F) -> impl PinInit<T, E> where F: FnOnce() -> Result<I, E>, I: PinInit<T, E>, pin_init_scope() argument 1351 pin_init_scope<T, E, F, I>(make_init: F) -> impl PinInit<T, E> where F: FnOnce() -> Result<I, E>, I: PinInit<T, E>, pin_init_scope() argument 1392 init_scope<T, E, F, I>(make_init: F) -> impl Init<T, E> where F: FnOnce() -> Result<I, E>, I: Init<T, E>, init_scope() argument 1395 init_scope<T, E, F, I>(make_init: F) -> impl Init<T, E> where F: FnOnce() -> Result<I, E>, I: Init<T, E>, init_scope() argument 1411 unsafe impl<T> Init<T> for T {} global() implementation 1415 unsafe impl<T> PinInit<T> for T { global() implementation 1447 write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 1452 write_pin_init<E>(self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 1456 type Initialized = &'static mut T; global() variable 1459 write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 1470 write_pin_init<E>(self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 1580 init_zeroed<T: Zeroable>() -> impl Init<T> init_zeroed() argument 1615 zeroed<T: Zeroable>() -> T zeroed() argument 1771 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1776 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1784 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1793 pin_init<E>(init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument [all...] |
| H A D | __internal.rs | 25 pub struct PhantomInvariant<T: ?Sized>(PhantomData<fn(T) -> T>); 27 impl<T: ?Sized> Clone for PhantomInvariant<T> { 34 impl<T: ?Sized> Copy for PhantomInvariant<T> {} in __init() 36 impl<T: ?Sized> Default for PhantomInvariant<T> { 43 impl<T 145 unsafe impl<T: ?Sized> HasInitData for T { global() implementation 191 init<E>(self: Pin<&mut Self>, init: impl PinInit<T, E>) -> Result<Pin<&mut T>, E> init() argument 267 let_binding(&mut self) -> &mut T let_binding() argument [all...] |
| /linux/rust/kernel/alloc/ |
| H A D | kbox.rs | 48 /// The kernel's [`Box`] type -- a heap allocation for a single value of type `T`. 104 pub struct Box<#[pointee] T: ?Sized, A: Allocator>(NonNull<T>, PhantomData<A>); 116 pub type KBox<T> = Box<T, super::allocator::Kmalloc>; 128 pub type VBox<T> = Box<T, super::allocator::Vmalloc>; 140 pub type KVBox<T> = Box<T, super::allocator::KVmalloc>; 144 unsafe impl<T, 203 into_raw(b: Self) -> *mut T into_raw() argument 211 leak<'a>(b: Self) -> &'a mut T leak() argument 230 assume_init(self) -> Box<T, A> assume_init() argument 240 write(mut self, value: T) -> Box<T, A> write() argument 256 new(x: T, flags: Flags) -> Result<Self, AllocError> new() argument 275 new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> new_uninit() argument 287 pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError> where A: 'static, pin() argument 340 pin_slice<Func, Item, E>( mut init: Func, len: usize, flags: Flags, ) -> Result<Pin<Box<[T], A>>, E> where Func: FnMut(usize) -> Item, Item: PinInit<T, E>, E: From<AllocError>, pin_slice() argument 343 pin_slice<Func, Item, E>( mut init: Func, len: usize, flags: Flags, ) -> Result<Pin<Box<[T], A>>, E> where Func: FnMut(usize) -> Item, Item: PinInit<T, E>, E: From<AllocError>, pin_slice() argument 378 forget_contents(this: Self) -> Box<MaybeUninit<T>, A> forget_contents() argument 398 drop_contents(this: Self) -> Box<MaybeUninit<T>, A> drop_contents() argument 409 into_inner(b: Self) -> T into_inner() argument 426 from(b: Box<T, A>) -> Self from() argument 439 write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 448 write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 465 try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E> where E: From<AllocError>, try_pin_init() argument 473 try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> where E: From<AllocError>, try_init() argument 506 borrow<'a>(ptr: *mut c_void) -> &'a T borrow() argument 512 borrow_mut<'a>(ptr: *mut c_void) -> &'a mut T borrow_mut() argument 541 borrow<'a>(ptr: *mut c_void) -> Pin<&'a T> borrow() argument 552 borrow_mut<'a>(ptr: *mut c_void) -> Pin<&'a mut T> borrow_mut() argument 572 deref(&self) -> &T deref() argument 584 deref_mut(&mut self) -> &mut T deref_mut() argument 614 borrow(&self) -> &T borrow() argument 642 borrow_mut(&mut self) -> &mut T borrow_mut() argument [all...] |
| H A D | kvec.rs | 100 /// [`Kmalloc`], [`Vmalloc`] or [`KVmalloc`]), written `Vec<T, A>`. 105 /// For zero-sized types the [`Vec`]'s pointer must be `dangling_mut::<T>`; no memory is allocated. 133 pub struct Vec<T, A: Allocator> { 134 ptr: NonNull<T>, 135 /// Represents the actual buffer size as `cap` times `size_of::<T>` bytes. 139 layout: ArrayLayout<T>, 155 pub type KVec<T> = Vec<T, Kmalloc>; 168 pub type VVec<T> = Vec<T, Vmallo 221 dec_len(&mut self, count: usize) -> &mut [T] dec_len() argument 244 as_slice(&self) -> &[T] as_slice() argument 250 as_mut_slice(&mut self) -> &mut [T] as_mut_slice() argument 257 as_mut_ptr(&mut self) -> *mut T as_mut_ptr() argument 264 as_ptr(&self) -> *const T as_ptr() argument 303 spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] spare_capacity_mut() argument 328 push(&mut self, v: T, flags: Flags) -> Result<(), AllocError> push() argument 351 push_within_capacity(&mut self, v: T) -> Result<(), PushError<T>> push_within_capacity() argument 366 push_within_capacity_unchecked(&mut self, v: T) push_within_capacity_unchecked() argument 401 insert_within_capacity( &mut self, index: usize, element: T, ) -> Result<(), InsertError<T>> insert_within_capacity() argument 402 insert_within_capacity( &mut self, index: usize, element: T, ) -> Result<(), InsertError<T>> insert_within_capacity() argument 442 pop(&mut self) -> Option<T> pop() argument 468 remove(&mut self, i: usize) -> Result<T, RemoveError> remove() argument 553 from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self from_raw_parts() argument 579 into_raw_parts(self) -> (*mut T, usize, usize) into_raw_parts() argument 707 drain_all(&mut self) -> DrainAll<'_, T> drain_all() argument 852 extend_with(&mut self, n: usize, value: T, flags: Flags) -> Result<(), AllocError> extend_with() argument 891 extend_from_slice(&mut self, other: &[T], flags: Flags) -> Result<(), AllocError> extend_from_slice() argument 907 from_elem(value: T, n: usize, flags: Flags) -> Result<Self, AllocError> from_elem() argument 932 resize(&mut self, new_len: usize, value: T, flags: Flags) -> Result<(), AllocError> resize() argument 967 from(b: Box<[T; N], A>) -> Vec<T, A> from() argument 1001 deref(&self) -> &[T] deref() argument 1013 deref_mut(&mut self) -> &mut [T] deref_mut() argument 1041 borrow(&self) -> &[T] borrow() argument 1067 borrow_mut(&mut self) -> &mut [T] borrow_mut() argument 1208 into_raw_parts(self) -> (*mut T, NonNull<T>, usize, usize) into_raw_parts() argument 1252 collect(self, flags: Flags) -> Vec<T, A> collect() argument 1325 next(&mut self) -> Option<T> next() argument 1444 next(&mut self) -> Option<T> next() argument [all...] |
| /linux/rust/syn/ |
| H A D | punctuated.rs | 49 pub struct Punctuated<T, P> { 50 inner: Vec<(T, P)>, 51 last: Option<Box<T>>, 54 impl<T, P> Punctuated<T, P> { 78 pub fn first(&self) -> Option<&T> { in first() argument 83 pub fn first_mut(&mut self) -> Option<&mut T> { in first_mut() argument 88 pub fn last(&self) -> Option<&T> { in last() argument 93 pub fn last_mut(&mut self) -> Option<&mut T> { in last_mut() argument 98 pub fn get(&self, index: usize) -> Option<&T> { in get() argument 109 pub fn get_mut(&mut self, index: usize) -> Option<&mut T> { in get_mut() argument [all …]
|
| /linux/tools/perf/tests/ |
| H A D | kmod-path.c | 44 #define T(path, an, k, c, n) \ macro 53 T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]"); in test__kmod_path__parse() 54 T("/xxxx/xxxx/x-x.ko", false , true, 0 , NULL ); in test__kmod_path__parse() 55 T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]"); in test__kmod_path__parse() 56 T("/xxxx/xxxx/x-x.ko", false , true, 0 , NULL ); in test__kmod_path__parse() 63 T("/xxxx/xxxx/x.ko.gz", true , true, 1 , "[x]"); in test__kmod_path__parse() 64 T("/xxxx/xxxx/x.ko.gz", false , true, 1 , NULL ); in test__kmod_path__parse() 65 T("/xxxx/xxxx/x.ko.gz", true , true, 1 , "[x]"); in test__kmod_path__parse() 66 T("/xxxx/xxxx/x.ko.gz", false , true, 1 , NULL ); in test__kmod_path__parse() 72 T("/xxxx/xxxx/x.gz", true , false, 1 , "x.gz"); in test__kmod_path__parse() [all …]
|
| /linux/rust/kernel/sync/ |
| H A D | atomic.rs | 34 /// This has the same size, alignment and bit validity as the underlying type `T`. And it disables 46 /// `self.0` is a valid `T`. 52 pub struct Atomic<T: AtomicType>(AtomicRepr<T::Repr>); 54 // SAFETY: `Atomic<T>` is safe to transfer between execution contexts because of the safety 56 unsafe impl<T: AtomicType> Send for Atomic<T> {} 58 // SAFETY: `Atomic<T>` is safe to share among execution contexts because all accesses are atomic. 59 unsafe impl<T: AtomicType> Sync for Atomic<T> {} 140 from_repr<T: AtomicType>(r: T::Repr) -> T from_repr() argument 228 as_ptr(&self) -> *mut T as_ptr() argument 238 get_mut(&mut self) -> &mut T get_mut() argument 269 load<Ordering: ordering::AcquireOrRelaxed>(&self, _: Ordering) -> T load() argument 299 store<Ordering: ordering::ReleaseOrRelaxed>(&self, v: T, _: Ordering) store() argument 340 xchg<Ordering: ordering::Ordering>(&self, v: T, _: Ordering) -> T xchg() argument 413 cmpxchg<Ordering: ordering::Ordering>( &self, mut old: T, new: T, o: Ordering, ) -> Result<T, T> cmpxchg() argument 414 cmpxchg<Ordering: ordering::Ordering>( &self, mut old: T, new: T, o: Ordering, ) -> Result<T, T> cmpxchg() argument 416 cmpxchg<Ordering: ordering::Ordering>( &self, mut old: T, new: T, o: Ordering, ) -> Result<T, T> cmpxchg() argument 458 try_cmpxchg<Ordering: ordering::Ordering>(&self, old: &mut T, new: T, _: Ordering) -> bool try_cmpxchg() argument [all...] |
| H A D | aref.rs | 10 //! The smart pointer [`ARef<T>`] acts similarly to [`Arc<T>`] in that it holds a refcount on the 18 //! [`Arc<T>`]: crate::sync::Arc 35 /// Additionally, it allows users to convert from a shared reference `&T` to an owned reference 36 /// [`ARef<T>`]. 78 pub struct ARef<T: AlwaysRefCounted> { 79 ptr: NonNull<T>, 80 _p: PhantomData<T>, 83 // SAFETY: It is safe to send `ARef<T>` to another thread when the underlying `T` i 136 into_raw(me: Self) -> NonNull<T> into_raw() argument [all...] |
| /linux/rust/kernel/ |
| H A D | debugfs.rs | 98 fn create_file<'a, T, E: 'a>( in create_file() 101 data: impl PinInit<T, E> + 'a, 102 file_ops: &'static FileOps<T>, 103 ) -> impl PinInit<File<T>, E> + 'a 105 T: Sync + 'static, 107 let scope = Scope::<T>::new(data, move |data| { 165 pub fn read_only_file<'a, T, E: 'a>( 168 data: impl PinInit<T, E> + 'a, 169 ) -> impl PinInit<File<T>, E> + 'a 171 T argument 74 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 77 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 78 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 79 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 144 read_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Send + Sync + 'static, read_only_file() argument 147 read_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Send + Sync + 'static, read_only_file() argument 148 read_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Send + Sync + 'static, read_only_file() argument 174 read_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + Send + Sync + 'static, read_binary_file() argument 175 read_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + Send + Sync + 'static, read_binary_file() argument 208 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 211 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 213 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 216 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 226 read_write_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Reader + Send + Sync + 'static, read_write_file() argument 229 read_write_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Reader + Send + Sync + 'static, read_write_file() argument 230 read_write_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Reader + Send + Sync + 'static, read_write_file() argument 242 read_write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + BinaryReader + Send + Sync + 'static, read_write_binary_file() argument 245 read_write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + BinaryReader + Send + Sync + 'static, read_write_binary_file() argument 246 read_write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + BinaryReader + Send + Sync + 'static, read_write_binary_file() argument 260 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 263 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 266 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 269 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 270 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 285 write_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Reader + Send + Sync + 'static, write_only_file() argument 288 write_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Reader + Send + Sync + 'static, write_only_file() argument 289 write_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Reader + Send + Sync + 'static, write_only_file() argument 302 write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryReader + Send + Sync + 'static, write_binary_file() argument 305 write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryReader + Send + Sync + 'static, write_binary_file() argument 306 write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryReader + Send + Sync + 'static, write_binary_file() argument 317 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 320 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 322 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 325 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 364 scope<'a, T: 'a, E: 'a, F>( &'a self, data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Scope<T>, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, scope() argument 367 scope<'a, T: 'a, E: 'a, F>( &'a self, data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Scope<T>, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, scope() argument 369 scope<'a, T: 'a, E: 'a, F>( &'a self, data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Scope<T>, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, scope() argument 411 new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b where F: for<'a> FnOnce(&'a T) + 'b, new() argument 435 new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b where F: for<'a> FnOnce(&'a T) -> Entry<'static> + 'b, new() argument 463 dir<E: 'a, F>( data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Self, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, dir() argument 468 dir<E: 'a, F>( data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Self, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, dir() argument 480 deref(&self) -> &T deref() argument 487 deref(&self) -> &T deref() argument 517 create_file<T: Sync>(&self, name: &CStr, data: &'data T, vtable: &'static FileOps<T>) create_file() argument 529 read_only_file<T: Writer + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) read_only_file() argument 542 read_binary_file<T: BinaryWriter + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) read_binary_file() argument 558 read_callback_file<T, F>(&self, name: &CStr, data: &'data T, _f: &'static F) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 561 read_callback_file<T, F>(&self, name: &CStr, data: &'data T, _f: &'static F) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 578 read_write_file<T: Writer + Reader + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) read_write_file() argument 594 read_write_binary_file<T: BinaryWriter + BinaryReader + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) read_write_binary_file() argument 610 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 613 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 618 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 619 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 634 write_only_file<T: Reader + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) write_only_file() argument 648 write_binary_file<T: BinaryReader + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) write_binary_file() argument 663 write_only_callback_file<T, W>(&self, name: &CStr, data: &'data T, _w: &'static W) where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_only_callback_file() argument 666 write_only_callback_file<T, W>(&self, name: &CStr, data: &'data T, _w: &'static W) where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_only_callback_file() argument [all...] |
| H A D | io.rs | 180 /// `MmioRaw<T>` is equivalent to `T __iomem *` in C. 188 pub struct MmioRaw<T: ?Sized> { 192 ptr: *mut T, in io_view_assert() 195 impl<T: ?Sized> Copy for MmioRaw<T> {} in io_view_assert() 196 impl<T: ?Sized> Clone for MmioRaw<T> { in io_view_assert() 204 unsafe impl<T: ?Sized> Send for MmioRaw<T> {} in io_view_assert() 249 as_ptr<'a, T: ?Sized + KnownSize>(view: Self::View<'a, T>) -> *mut T as_ptr() argument 259 project_view<'a, T: ?Sized + KnownSize, U: ?Sized + KnownSize>( view: Self::View<'a, T>, ptr: *mut U, ) -> Self::View<'a, U> project_view() argument 274 io_read<'a>(view: Self::View<'a, T>) -> T io_read() argument 277 io_write<'a>(view: Self::View<'a, T>, value: T) io_write() argument 300 copy_read<T: FromBytes>(view: Self::View<'_, T>) -> T copy_read() argument 324 copy_write<T: IntoBytes>(view: Self::View<'_, T>, value: T) copy_write() argument 844 try_read<T, L>(self, location: L) -> Result<T> where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, try_read() argument 877 try_write<T, L>(self, location: L, value: T) -> Result where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, try_write() argument 879 try_write<T, L>(self, location: L, value: T) -> Result where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, try_write() argument 921 try_write_reg<T, L, V>(self, value: V) -> Result where L: IoLoc<Self::Target, T>, V: LocatedRegister<Self::Target, Location = L, Value = T>, Self::Backend: IoCapable<L::IoType>, try_write_reg() argument 923 try_write_reg<T, L, V>(self, value: V) -> Result where L: IoLoc<Self::Target, T>, V: LocatedRegister<Self::Target, Location = L, Value = T>, Self::Backend: IoCapable<L::IoType>, try_write_reg() argument 955 try_update<T, L, F>(self, location: L, f: F) -> Result where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, F: FnOnce(T) -> T, try_update() argument 957 try_update<T, L, F>(self, location: L, f: F) -> Result where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, F: FnOnce(T) -> T, try_update() argument 959 try_update<T, L, F>(self, location: L, f: F) -> Result where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, F: FnOnce(T) -> T, try_update() argument 992 read<T, L>(self, location: L) -> T where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, read() argument 994 read<T, L>(self, location: L) -> T where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, read() argument 1023 write<T, L>(self, location: L, value: T) where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, write() argument 1025 write<T, L>(self, location: L, value: T) where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, write() argument 1065 write_reg<T, L, V>(self, value: V) where L: IoLoc<Self::Target, T>, V: LocatedRegister<Self::Target, Location = L, Value = T>, Self::Backend: IoCapable<L::IoType>, write_reg() argument 1067 write_reg<T, L, V>(self, value: V) where L: IoLoc<Self::Target, T>, V: LocatedRegister<Self::Target, Location = L, Value = T>, Self::Backend: IoCapable<L::IoType>, write_reg() argument 1099 update<T, L, F>(self, location: L, f: F) where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, F: FnOnce(T) -> T, update() argument 1101 update<T, L, F>(self, location: L, f: F) where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, F: FnOnce(T) -> T, update() argument 1103 update<T, L, F>(self, location: L, f: F) where L: IoLoc<Self::Target, T>, Self::Backend: IoCapable<L::IoType>, F: FnOnce(T) -> T, update() argument 1114 impl<'a, T: IoBase<'a>> Io<'a> for T {} global() implementation 1161 as_view(self) -> Mmio<'a, T> as_view() argument 1173 as_ptr<'a, T: ?Sized + KnownSize>(view: Self::View<'a, T>) -> *mut T as_ptr() argument 1179 project_view<'a, T: ?Sized + KnownSize, U: ?Sized + KnownSize>( _view: Self::View<'a, T>, ptr: *mut U, ) -> Self::View<'a, U> project_view() argument 1265 as_ptr<'a, T: ?Sized + KnownSize>(view: Self::View<'a, T>) -> *mut T as_ptr() argument 1271 project_view<'a, T: ?Sized + KnownSize, U: ?Sized + KnownSize>( view: Self::View<'a, T>, ptr: *mut U, ) -> Self::View<'a, U> project_view() argument 1284 as_view(self) -> RelaxedMmio<'a, T> as_view() argument 1312 relaxed(self) -> RelaxedMmio<'a, T> relaxed() argument 1332 as_ptr<'a, T: ?Sized + KnownSize>(view: Self::View<'a, T>) -> *mut T as_ptr() argument 1338 project_view<'a, T: ?Sized + KnownSize, U: ?Sized + KnownSize>( _view: Self::View<'a, T>, ptr: *mut U, ) -> Self::View<'a, U> project_view() argument 1405 copy_read<T: FromBytes>(view: Self::View<'_, T>) -> T copy_read() argument 1416 copy_write<T: IntoBytes>(view: Self::View<'_, T>, value: T) copy_write() argument 1473 as_ptr(self) -> *mut T as_ptr() argument 1534 as_ptr<'a, T: ?Sized + KnownSize>(view: Self::View<'a, T>) -> *mut T as_ptr() argument 1543 project_view<'a, T: ?Sized + KnownSize, U: ?Sized + KnownSize>( view: Self::View<'a, T>, ptr: *mut U, ) -> Self::View<'a, U> project_view() argument 1561 io_read(view: Self::View<'_, T>) -> T io_read() argument 1569 io_write<'a>(view: Self::View<'a, T>, value: T) io_write() argument 1599 copy_read<T: FromBytes>(view: Self::View<'_, T>) -> T copy_read() argument 1607 copy_write<T: IntoBytes>(view: Self::View<'_, T>, value: T) copy_write() argument 1620 as_view(self) -> IoSysMap<'a, T> as_view() argument [all...] |
| H A D | list.rs | 279 pub struct List<T: ?Sized + ListItem<ID>, const ID: u64 = 0> { 281 _ty: PhantomData<ListArc<T, ID>>, 286 unsafe impl<T, const ID: u64> Send for List<T, ID> 288 ListArc<T, ID>: Send, 289 T: ?Sized + ListItem<ID>, 294 unsafe impl<T, const ID: u64> Sync for List<T, ID> 296 ListArc<T, ID>: Sync, 297 T: ?Sized + ListItem<ID>, 436 pub struct ListLinksSelfPtr<T: ?Sized, const ID: u64 = 0> { 443 self_ptr: Opaque<*const T>, [all …]
|
| H A D | types.rs | 115 /// Note that for types like [`Arc`], an `&mut Arc<T>` only gives you immutable access to the 118 /// In the case of `Box<T>`, this method gives you the ability to modify the inner `T`, but it 229 pub struct ScopeGuard<T, F: FnOnce(T)>(Option<(T, F)>); 231 impl<T, F: FnOnce(T)> ScopeGuard<T, F> { in dismiss() 233 pub fn new_with_data(data: T, cleanup_fun in dismiss() 224 new_with_data(data: T, cleanup_func: F) -> Self new_with_data() argument 230 dismiss(mut self) -> T dismiss() argument 247 deref(&self) -> &T deref() argument 254 deref_mut(&mut self) -> &mut T deref_mut() argument 394 get(&self) -> *mut T get() argument 402 cast_into(this: *const Self) -> *mut T cast_into() argument 414 pin_init<E>(slot: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument [all...] |
| /linux/rust/kernel/debugfs/ |
| H A D | file_ops.rs | 25 /// `FileOps<T>` will always contain an `operations` which is safe to use for a file backed 26 /// off an inode which has a pointer to a `T` in its private data that is safe to convert 28 pub(super) struct FileOps<T> { 33 _phantom: PhantomData<T>, 36 impl<T> FileOps<T> { in new() 40 /// inode has a pointer to `T` in its private data that is safe to convert into a reference. in new() 57 impl<T: Adapter> FileOps<T> { 58 pub(super) const fn adapt(&self) -> &FileOps<T 122 impl<T: Writer + Sync> ReadFile<T> for T { global() implementation 140 read<T: Reader + Sync>(data: &T, buf: *const c_char, count: usize) -> isize read() argument 165 let data = unsafe { &*(seq.private as *const T) }; write() constant 174 impl<T: Writer + Reader + Sync> ReadWriteFile<T> for T { global() implementation 224 let data = unsafe { &*((*file).private_data as *const T) }; write_only_write() constant 232 impl<T: Reader + Sync> WriteFile<T> for T { global() implementation 285 impl<T: BinaryWriter + Sync> BinaryReadFile<T> for T { global() implementation 340 impl<T: BinaryReader + Sync> BinaryWriteFile<T> for T { global() implementation 365 impl<T: BinaryWriter + BinaryReader + Sync> BinaryReadWriteFile<T> for T { global() implementation [all...] |
| /linux/rust/proc-macro2/ |
| H A D | rcvec.rs | 9 pub(crate) struct RcVec<T> { 10 inner: Rc<Vec<T>>, 13 pub(crate) struct RcVecBuilder<T> { 14 inner: Vec<T>, 17 pub(crate) struct RcVecMut<'a, T> { 18 inner: &'a mut Vec<T>, 22 pub(crate) struct RcVecIntoIter<T> { 23 inner: vec::IntoIter<T>, 26 impl<T> RcVec<T> { 35 pub(crate) fn iter(&self) -> slice::Iter<T> { in iter() argument [all …]
|
| /linux/rust/kernel/drm/ |
| H A D | device.rs | 87 /// Both `Device<T, Ioctl>` and `Device<T, Registered>` dereference to `Device<T>` ([`Normal`]), 96 /// [`AlwaysRefCounted`] is only implemented for `Device<T, Normal>`, making this the required 111 /// The parent bus device is bound for the duration of any reference to a `Device<T, Registered>`. 144 pub struct UnregisteredDevice<T: drm::Driver>(ARef<Device<T, Normal>>, NotThreadSafe); in new() 146 impl<T: drm::Driver> Deref for UnregisteredDevice<T> { in new() 147 type Target = Device<T, Norma in new() 268 run(ptr: ARef<Device<T>>) run() argument 288 raw_get_work(ptr: *mut Self) -> *mut Work<Device<T>, ID> raw_get_work() argument 296 work_container_of(ptr: *mut Work<Device<T>, ID>) -> *mut Self work_container_of() argument [all...] |
| /linux/rust/kernel/list/ |
| H A D | arc.rs | 19 /// a [`ListArc`] exists or not. We refer to this logic as "the tracking inside `T`". 21 /// We allow the case where the tracking inside `T` thinks that a [`ListArc`] exists, but actually, 28 /// A consequence of the above is that you may implement the tracking inside `T` by not actually 144 /// relevant tracking is referred to as "the tracking inside `T`", and the [`ListArcSafe`] trait 147 /// Note that we allow the case where the tracking inside `T` thinks that a `ListArc` exists, but 159 /// * The tracking inside `T` is aware that a `ListArc` reference exists. 164 pub struct ListArc<T, const ID: u64 = 0> 166 T: ListArcSafe<ID> + ?Sized, 168 arc: Arc<T>, 171 impl<T 173 new(contents: T, flags: Flags) -> Result<Self, AllocError> new() argument 183 pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Self, E> where E: From<AllocError>, pin_init() argument 194 init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> where E: From<AllocError>, init() argument 237 pair_from_unique<const ID2: u64>(unique: UniqueArc<T>) -> (Self, ListArc<T, ID2>) where T: ListArcSafe<ID2>, pair_from_unique() argument 249 pair_from_pin_unique<const ID2: u64>( mut unique: Pin<UniqueArc<T>>, ) -> (Self, ListArc<T, ID2>) where T: ListArcSafe<ID2>, pair_from_pin_unique() argument 250 pair_from_pin_unique<const ID2: u64>( mut unique: Pin<UniqueArc<T>>, ) -> (Self, ListArc<T, ID2>) where T: ListArcSafe<ID2>, pair_from_pin_unique() argument 337 transmute_to_arc(self) -> Arc<T> transmute_to_arc() argument 349 into_raw(self) -> *const T into_raw() argument 371 into_arc(self) -> Arc<T> into_arc() argument 380 clone_arc(&self) -> Arc<T> clone_arc() argument 391 as_arc(&self) -> &Arc<T> as_arc() argument 400 as_arc_borrow(&self) -> ArcBorrow<'_, T> as_arc_borrow() argument 440 as_ref(&self) -> &Arc<T> as_ref() argument [all...] |
| /linux/rust/zerocopy/src/pointer/ |
| H A D | transmute.rs | 213 /// It is sound for safe code to operate on a `&T` and a `&Self` pointing to the 216 pub unsafe trait SharedCompatible<T: ?Sized> {} 218 // SAFETY: Trivially sound to have multiple `&T` pointing to the same referent. 219 unsafe impl<T: ?Sized> SharedCompatible<T> for T {} 244 impl_transitive_transmute_from!(T => MaybeUninit<T> => T => Wrapping<T>); 217 unsafe impl<T: ?Sized> InvariantsEq<T> for T {} global() implementation 258 unsafe impl<T: ?Sized> InvariantsEq<ManuallyDrop<T>> for T {} global() implementation 329 impl<T: ?Sized> SizeEq<T> for T { global() implementation 487 impl<T> SizeEq<MaybeUninit<T>> for T { global() implementation [all...] |
| H A D | ptr.rs | 35 /// `Ptr<T>` is similar to [`NonNull<T>`], but it is more restrictive in the 53 /// `Ptr<'a, T>` is [covariant] in `'a` and invariant in `T`. 55 /// [`NonNull<T>`]: core::ptr::NonNull 57 pub struct Ptr<'a, T, I> 59 T: ?Sized, 70 // SAFETY: `PtrInner<'a, T>` is covariant in `'a` and invariant in `T`. 71 ptr: PtrInner<'a, T>, 92 from_inner(ptr: PtrInner<'a, T>) -> Ptr<'a, T, I> from_inner() argument 105 as_inner(&self) -> PtrInner<'a, T> as_inner() argument 238 as_ref(self) -> &'a T as_ref() argument 294 reborrow<'b>(&'b mut self) -> Ptr<'b, T, I> where 'a: 'b, reborrow() argument 340 reborrow_shared<'b>(&'b mut self) -> Ptr<'b, T, (Shared, I::Alignment, I::Validity)> where 'a: 'b, reborrow_shared() argument 388 as_mut(self) -> &'a mut T as_mut() argument 439 transmute<U, V, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, V)> where V: Validity, U: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, <U as SizeEq<T>>::CastFrom, R> + SizeEq<T> + ?Sized, transmute() argument 451 transmute_with<U, V, C, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, V)> where V: Validity, U: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, C, R> + ?Sized, C: CastExact<T, U>, transmute_with() argument 452 transmute_with<U, V, C, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, V)> where V: Validity, U: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, C, R> + ?Sized, C: CastExact<T, U>, transmute_with() argument 472 recall_validity<V, R>(self) -> Ptr<'a, T, (I::Aliasing, I::Alignment, V)> where V: Validity, T: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, IdCast, R>, recall_validity() argument 475 recall_validity<V, R>(self) -> Ptr<'a, T, (I::Aliasing, I::Alignment, V)> where V: Validity, T: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, IdCast, R>, recall_validity() argument 514 project_transmute_unchecked<U: ?Sized, V, P>( self, ) -> Ptr<'a, U, (I::Aliasing, Unaligned, V)> where V: Validity, P: crate::pointer::cast::Project<T, U>, project_transmute_unchecked() argument 561 into_unalign( self, ) -> Ptr<'a, crate::Unalign<T>, (I::Aliasing, Aligned, I::Validity)> into_unalign() argument 638 assume_invariants<H: Invariants>(self) -> Ptr<'a, T, H> assume_invariants() argument 653 unify_invariants< H: Invariants<Aliasing = I::Aliasing, Alignment = I::Alignment, Validity = I::Validity>, >( self, ) -> Ptr<'a, T, H> unify_invariants() argument 669 assume_alignment<A: Alignment>( self, ) -> Ptr<'a, T, (I::Aliasing, A, I::Validity)> assume_alignment() argument 680 try_into_aligned( self, ) -> Result<Ptr<'a, T, (I::Aliasing, Aligned, I::Validity)>, AlignmentError<Self, T>> where T: Sized, try_into_aligned() argument 699 bikeshed_recall_aligned(self) -> Ptr<'a, T, (I::Aliasing, Aligned, I::Validity)> where T: crate::Unaligned, bikeshed_recall_aligned() argument 719 assume_validity<V: Validity>( self, ) -> Ptr<'a, T, (I::Aliasing, I::Alignment, V)> assume_validity() argument 735 assume_initialized( self, ) -> Ptr<'a, T, (I::Aliasing, I::Alignment, Initialized)> assume_initialized() argument 749 assume_valid(self) -> Ptr<'a, T, (I::Aliasing, I::Alignment, Valid)> assume_valid() argument 770 try_into_valid<R, S>( mut self, ) -> Result<Ptr<'a, T, (I::Aliasing, I::Alignment, Valid)>, ValidityError<Self, T>> where T: TryFromBytes + Read<I::Aliasing, R> + TryTransmuteFromPtr<T, I::Aliasing, I::Validity, Valid, IdCast, S>, ReadOnly<T>: Read<I::Aliasing, R>, I::Aliasing: Reference, I: Invariants<Validity = Initialized>, try_into_valid() argument 774 try_into_valid<R, S>( mut self, ) -> Result<Ptr<'a, T, (I::Aliasing, I::Alignment, Valid)>, ValidityError<Self, T>> where T: TryFromBytes + Read<I::Aliasing, R> + TryTransmuteFromPtr<T, I::Aliasing, I::Validity, Valid, IdCast, S>, ReadOnly<T>: Read<I::Aliasing, R>, I::Aliasing: Reference, I: Invariants<Validity = Initialized>, try_into_valid() argument 798 forget_aligned(self) -> Ptr<'a, T, (I::Aliasing, Unaligned, I::Validity)> forget_aligned() argument 834 cast_unchecked<U, C: Cast<T, U>>( self, ) -> Ptr<'a, U, (I::Aliasing, Unaligned, I::Validity)> where U: 'a + CastableFrom<T, I::Validity, I::Validity> + ?Sized, cast_unchecked() argument 838 cast_unchecked<U, C: Cast<T, U>>( self, ) -> Ptr<'a, U, (I::Aliasing, Unaligned, I::Validity)> where U: 'a + CastableFrom<T, I::Validity, I::Validity> + ?Sized, cast_unchecked() argument 863 cast<U, C, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, I::Validity)> where T: MutationCompatible<U, I::Aliasing, I::Validity, I::Validity, R>, U: 'a + ?Sized + CastableFrom<T, I::Validity, I::Validity>, C: Cast<T, U>, cast() argument 864 cast<U, C, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, I::Validity)> where T: MutationCompatible<U, I::Aliasing, I::Validity, I::Validity, R>, U: 'a + ?Sized + CastableFrom<T, I::Validity, I::Validity>, C: Cast<T, U>, cast() argument 940 try_with_unchecked<U, J, E, F>( self, f: F, ) -> Result<Ptr<'a, U, J>, E::Mapped> where U: 'a + ?Sized, J: Invariants<Aliasing = I::Aliasing>, E: TryWithError<Self>, F: FnOnce(Ptr<'a, T, I>) -> Result<Ptr<'a, U, J>, E>, try_with_unchecked() argument 987 try_with<U, J, E, F>(self, f: F) -> Result<Ptr<'a, U, J>, E::Mapped> where U: 'a + ?Sized, J: Invariants<Aliasing = I::Aliasing>, E: TryWithError<Self>, F: FnOnce(Ptr<'a, T, I>) -> Result<Ptr<'a, U, J>, E>, I: Invariants<Aliasing = Shared>, try_with() argument 1020 as_bytes<R>(self) -> Ptr<'a, [u8], (I::Aliasing, Aligned, Valid)> where [u8]: TransmuteFromPtr<T, I::Aliasing, I::Validity, Valid, AsBytesCast, R>, as_bytes() argument 1035 as_slice(self) -> Ptr<'a, [T], I> as_slice() argument 1217 get_mut(self) -> Ptr<'a, T, I> get_mut() argument 1273 iter(self) -> impl Iterator<Item = Ptr<'a, T, I>> iter() argument 1346 test<T, I, const N: usize>(metas: I) where T: ?Sized + KnownLayout + Immutable + FromBytes, I: IntoIterator<Item = Option<T::PointerMetadata>> + Clone, test() argument 1378 validate_and_get_len< T: ?Sized + KnownLayout + FromBytes + Immutable, >( slf: Ptr<'_, T, (Shared, Aligned, Initialized)>, ) -> usize test() argument 1386 let t: *const T = t; test() constant [all...] |
| H A D | mod.rs | 31 pub type Maybe<'a, T, Alignment = invariant::Unaligned> = 32 Ptr<'a, ReadOnly<T>, (invariant::Shared, Alignment, invariant::Initialized)>; 35 pub(crate) fn is_zeroed<T, I>(ptr: Ptr<'_, T, I>) -> bool in is_zeroed() argument 37 T: crate::Immutable + crate::KnownLayout, in is_zeroed() 97 unsafe impl<T: ?Sized> Project<T, T> for IdCast { 99 fn project(src: PtrInner<'_, T>) -> *mut T { 102 project(src: PtrInner<'_, T>) -> *mut T project() argument [all...] |
| /linux/rust/kernel/ptr/ |
| H A D | projection.rs | 37 #[diagnostic::on_unimplemented(message = "`{Self}` cannot be used to index `{T}`")] 39 pub unsafe trait ProjectIndex<T: ?Sized>: Sized { 43 fn get(self, slice: *mut T) -> Option<*mut Self::Output>; in get() 46 fn index(self, slice: *mut T) -> *mut Self::Output; 50 fn build_index(self, slice: *mut T) -> *mut Self::Output { 61 unsafe impl<T, I, const N: usize> ProjectIndex<[T; N]> for I 63 I: ProjectIndex<[T]>, 65 type Output = <I as ProjectIndex<[T]>>::Output; 68 fn get(self, slice: *mut [T; in index() 78 get(self, slice: *mut [T]) -> Option<*mut T> get() argument 93 get(self, slice: *mut [T]) -> Option<*mut [T]> get() argument 110 get(self, slice: *mut [T]) -> Option<*mut [T]> get() argument 120 get(self, slice: *mut [T]) -> Option<*mut [T]> get() argument 130 get(self, slice: *mut [T]) -> Option<*mut [T]> get() argument 166 unsafe impl<T> ProjectField<false> for T { global() implementation 184 unsafe impl<T: Deref> ProjectField<true> for T { global() implementation [all...] |