| /linux/rust/kernel/num/ |
| H A D | bounded.rs | 42 fn fits_within<T: Integer>(value: T, num_bits: u32) -> bool { in fits_within() argument 43 fits_within!(value, T, num_bits) in fits_within() 240 pub struct Bounded<T: Integer, const N: u32>(T); 284 impl<T, const N: u32> Bounded<T, N> 286 T: Integer, 296 const unsafe fn __new(value: T) -> Self { in __new() 301 const_assert!(N <= T::BITS); in __new() 337 pub fn try_new(value: T) -> Option<Self> { in try_new() 376 pub fn from_expr(expr: T) -> Self { in from_expr() 399 pub const fn get(self) -> T { in get() 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 | 118 pub struct Unalign<T>(T); 123 impl_known_layout!(T => Unalign<T>); 150 impl_or_verify!(T => Unaligned for Unalign<T>); 151 impl_or_verify!(T: Immutable => Immutable for Unalign<T>); 153 T: TryFromBytes => TryFromBytes for Unalign<T>; 154 |c| T::is_bit_valid(c.transmute::<_, _, BecauseImmutable>()) 156 impl_or_verify!(T: FromZeros => FromZeros for Unalign<T>); 157 impl_or_verify!(T: FromBytes => FromBytes for Unalign<T>); 158 impl_or_verify!(T: IntoBytes => IntoBytes for Unalign<T>); 164 impl<T: Copy> Clone for Unalign<T> { [all …]
|
| H A D | ref.rs | 62 pub struct Ref<B, T: ?Sized>( 67 PhantomData<T>, 70 impl<B, T: ?Sized> Ref<B, T> { 82 pub(crate) unsafe fn new_unchecked(bytes: B) -> Ref<B, T> { in new_unchecked() argument 89 impl<B: ByteSlice, T: ?Sized> Ref<B, T> { 112 impl<B: ByteSliceMut, T: ?Sized> Ref<B, T> { 135 impl<'a, B: IntoByteSlice<'a>, T: ?Sized> Ref<B, T> { 158 impl<'a, B: IntoByteSliceMut<'a>, T: ?Sized> Ref<B, T> { 181 impl<B: CloneableByteSlice + Clone, T: ?Sized> Clone for Ref<B, T> { 183 fn clone(&self) -> Ref<B, T> { in clone() 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/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/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/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 1061 chain<F>(self, f: F) -> ChainInit<Self, F, T, E> where F: FnOnce(&mut T) -> Result<(), E>, chain() argument 1117 pin_init_from_closure<T: ?Sized, E>( f: impl FnOnce(*mut T) -> Result<(), E>, ) -> impl PinInit<T, E> pin_init_from_closure() argument 1136 init_from_closure<T: ?Sized, E>( f: impl FnOnce(*mut T) -> Result<(), E>, ) -> impl Init<T, E> init_from_closure() argument 1146 cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl PinInit<U, E> cast_pin_init() argument 1162 cast_init<T, U, E>(init: impl Init<T, E>) -> impl Init<U, E> cast_init() argument 1176 uninit<T, E>() -> impl Init<MaybeUninit<T>, E> uninit() argument 1191 init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl Init<[T; N], E> where I: Init<T, E>, init_array_from_fn() argument 1195 init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl Init<[T; N], E> where I: Init<T, E>, global() argument 1234 pin_init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl PinInit<[T; N], E> where I: PinInit<T, E>, pin_init_array_from_fn() argument 1238 pin_init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl PinInit<[T; N], E> where I: PinInit<T, E>, global() argument 1288 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 1291 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 1331 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 1334 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 1350 unsafe impl<T> Init<T> for T { global() implementation 1360 unsafe impl<T> PinInit<T> for T { global() implementation 1398 write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 1403 write_pin_init<E>(self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 1407 type Initialized = &'static mut T; global() variable 1409 write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 1419 write_pin_init<E>(self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 1534 unsafe impl<T> ZeroableOption for &T {} global() implementation 1537 unsafe impl<T> ZeroableOption for &mut T {} global() implementation 1546 init_zeroed<T: Zeroable>() -> impl Init<T> init_zeroed() argument 1577 zeroed<T: Zeroable>() -> T zeroed() argument 1691 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1695 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1702 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1710 pin_init<E>(init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument [all...] |
| H A D | __internal.rs | 20 pub struct PhantomInvariant<T: ?Sized>(PhantomData<fn(T) -> T>); 22 impl<T: ?Sized> Clone for PhantomInvariant<T> { 29 impl<T: ?Sized> Copy for PhantomInvariant<T> {} 31 impl<T: ?Sized> Default for PhantomInvariant<T> { 38 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/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 | 120 pub struct MmioRaw<T: ?Sized> { 124 ptr: *mut T, 127 impl<T: ?Sized> Copy for MmioRaw<T> {} 128 impl<T: ?Sized> Clone for MmioRaw<T> { 136 unsafe impl<T: ?Sized> Send for MmioRaw<T> {} 138 unsafe impl<T: ?Sized> Sync for MmioRaw<T> {} 140 impl<T> MmioRaw<T> { 162 impl<T: ?Sized + KnownSize> MmioRaw<T> { 243 type View<'a, T: ?Sized + KnownSize>: IoBase<'a, Backend = Self, Target = T>; 249 fn as_ptr<'a, T: ?Sized + KnownSize>(view: Self::View<'a, T>) -> *mut T; in as_ptr() 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 | 28 /// `FileOps<T>` will always contain an `operations` which is safe to use for a file backed 29 /// off an inode which has a pointer to a `T` in its private data that is safe to convert 31 pub(super) struct FileOps<T> { 36 _phantom: PhantomData<T>, in new() 39 impl<T> FileOps<T> { in new() 43 /// inode has a pointer to `T` in its private data that is safe to convert into a reference. in new() 60 impl<T: Adapter> FileOps<T> { 61 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 | 214 pub unsafe trait InvariantsEq<T: ?Sized> {} 217 unsafe impl<T: ?Sized> InvariantsEq<T> for T {} implementation 242 impl_transitive_transmute_from!(T => MaybeUninit<T> => T => Wrapping<T>); 243 impl_transitive_transmute_from!(T => Wrapping<T> => T => MaybeUninit<T>); 256 unsafe impl<T: ?Sized> InvariantsEq<T> for ManuallyDrop<T> {} 258 unsafe impl<T: ?Sized> InvariantsEq<ManuallyDrop<T>> for T {} implementation 329 impl<T: ?Sized> SizeEq<T> for T { implementation 389 const _: () = unsafe { unsafe_impl_for_transparent_wrapper!(pub T: ?Sized => ManuallyDrop<T>) }; 395 const _: () = unsafe { unsafe_impl_for_transparent_wrapper!(pub T => Unalign<T>) }; 403 const _: () = unsafe { unsafe_impl_invariants_eq!(T => T, Unalign<T>) }; [all …]
|
| H A D | ptr.rs | 57 pub struct Ptr<'a, T, I> 59 T: ?Sized, 71 ptr: PtrInner<'a, T>, 75 impl<'a, T, I> Ptr<'a, T, I> 77 T: 'a + ?Sized, 92 pub(crate) unsafe fn from_inner(ptr: PtrInner<'a, T>) -> Ptr<'a, T, I> { in from_inner() argument 105 pub fn as_inner(&self) -> PtrInner<'a, T> { in as_inner() argument 135 impl<'a, T, I> Copy for Ptr<'a, T, I> 137 T: 'a + ?Sized, 143 impl<'a, T, I> Clone for Ptr<'a, T, I> [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() 100 unsafe impl<T: ?Sized> Project<T, T> for IdCast { 102 fn project(src: PtrInner<'_, T>) -> *mut T { in project() argument 108 unsafe impl<T: ?Sized> Cast<T, T> for IdCast {} 111 unsafe impl<T: ?Sized> CastExact<T, T> for IdCast {} 251 unsafe impl<T: ?Sized, F, const VARIANT_ID: i128, const FIELD_ID: i128> Project<T, T::Type> 254 T: HasField<F, VARIANT_ID, FIELD_ID>, [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...] |