Lines Matching +full:sync +full:- +full:read

1 // SPDX-License-Identifier: GPL-2.0
15 use crate::sync::Arc;
53 fn create(name: &CStr, parent: Option<&Dir>) -> Self { in create()
57 // If the parent couldn't be allocated, just early-return in create()
79 ) -> impl PinInit<File<T>, E> + 'a in create_file()
81 T: Sync + 'static, in create_file()
95 scope <- scope in create_file()
109 pub fn new(name: &CStr) -> Self { in new()
123 pub fn subdir(&self, name: &CStr) -> Self { in subdir()
127 /// Creates a read-only file in this directory.
148 ) -> impl PinInit<File<T>, E> + 'a in read_only_file()
150 T: Writer + Send + Sync + 'static, in read_only_file()
156 /// Creates a read-only binary file in this directory.
175 ) -> impl PinInit<File<T>, E> + 'a in read_binary_file()
177 T: BinaryWriter + Send + Sync + 'static, in read_binary_file()
182 /// Creates a read-only file in this directory, with contents from a callback.
184 /// `f` must be a function item or a non-capturing closure.
190 /// # use core::sync::atomic::{AtomicU32, Ordering};
213 ) -> impl PinInit<File<T>, E> + 'a in read_callback_file()
215 T: Send + Sync + 'static, in read_callback_file()
216 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, in read_callback_file() argument
222 /// Creates a read-write file in this directory.
230 ) -> impl PinInit<File<T>, E> + 'a in read_write_file()
232 T: Writer + Reader + Send + Sync + 'static, in read_write_file()
238 /// Creates a read-write binary file in this directory.
246 ) -> impl PinInit<File<T>, E> + 'a in read_write_binary_file()
248 T: BinaryWriter + BinaryReader + Send + Sync + 'static, in read_write_binary_file()
254 /// Creates a read-write file in this directory, with logic from callbacks.
258 /// `f` and `w` must be function items or non-capturing closures.
266 ) -> impl PinInit<File<T>, E> + 'a in read_write_callback_file()
268 T: Send + Sync + 'static, in read_write_callback_file()
269 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, in read_write_callback_file() argument
270 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, in read_write_callback_file() argument
279 /// Creates a write-only file in this directory.
289 ) -> impl PinInit<File<T>, E> + 'a in write_only_file()
291 T: Reader + Send + Sync + 'static, in write_only_file()
296 /// Creates a write-only binary file in this directory.
306 ) -> impl PinInit<File<T>, E> + 'a in write_binary_file()
308 T: BinaryReader + Send + Sync + 'static, in write_binary_file()
313 /// Creates a write-only file in this directory, with write logic from a callback.
315 /// `w` must be a function item or a non-capturing closure.
322 ) -> impl PinInit<File<T>, E> + 'a in write_callback_file()
324 T: Send + Sync + 'static, in write_callback_file()
325 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, in write_callback_file() argument
338 fn scoped_dir<'data>(&self, name: &CStr) -> ScopedDir<'data, 'static> { in scoped_dir()
367 ) -> impl PinInit<Scope<T>, E> + 'a in scope()
390 // This order is load-bearing for drops - `_entry` must be dropped before `data`.
411 fn new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b in new()
417 data <- data, in new()
430 fn entry_mut(self: Pin<&mut Self>) -> &mut Entry<'static> { in entry_mut()
435 fn new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b in new()
437 F: for<'a> FnOnce(&'a T) -> Entry<'static> + 'b, in new()
442 data <- data, in new()
466 ) -> impl PinInit<Self, E> + 'a in dir()
480 fn deref(&self) -> &T { in deref()
487 fn deref(&self) -> &T { in deref()
500 _phantom: PhantomData<fn(&'data ()) -> &'dir ()>,
507 pub fn dir<'dir2>(&'dir2 self, name: &CStr) -> ScopedDir<'data, 'dir2> { in dir()
517 fn create_file<T: Sync>(&self, name: &CStr, data: &'data T, vtable: &'static FileOps<T>) { in create_file()
522 /// Creates a read-only file in this directory.
529 pub fn read_only_file<T: Writer + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) { in read_only_file()
533 /// Creates a read-only binary file in this directory.
539 pub fn read_binary_file<T: BinaryWriter + Send + Sync + 'static>( in read_binary_file()
547 /// Creates a read-only file in this directory, with contents from a callback.
552 /// `f` must be a function item or a non-capturing closure.
560 T: Send + Sync + 'static, in read_callback_file()
561 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, in read_callback_file() argument
567 /// Creates a read-write file in this directory.
575 pub fn read_write_file<T: Writer + Reader + Send + Sync + 'static>( in read_write_file()
584 /// Creates a read-write binary file in this directory.
591 pub fn read_write_binary_file<T: BinaryWriter + BinaryReader + Send + Sync + 'static>( in read_write_binary_file()
600 /// Creates a read-write file in this directory, with logic from callbacks.
604 /// `f` and `w` must be function items or non-capturing closures.
617 T: Send + Sync + 'static, in read_write_callback_file()
618 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, in read_write_callback_file() argument
619 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, in read_write_callback_file() argument
627 /// Creates a write-only file in this directory.
634 pub fn write_only_file<T: Reader + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) { in write_only_file()
639 /// Creates a write-only binary file in this directory.
645 pub fn write_binary_file<T: BinaryReader + Send + Sync + 'static>( in write_binary_file()
653 /// Creates a write-only file in this directory, with write logic from a callback.
657 /// `w` must be a function item or a non-capturing closure.
665 T: Send + Sync + 'static, in write_only_callback_file()
666 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, in write_only_callback_file() argument
674 fn empty() -> Self { in empty()
682 fn into_entry(self) -> Entry<'dir> { in into_entry()
693 fn new(name: &CStr) -> ScopedDir<'data, 'static> { in new()