Lines Matching +full:sync +full:- +full:write
1 // SPDX-License-Identifier: GPL-2.0
12 use crate::sync::Arc;
77 fn create(name: &CStr, parent: Option<&Dir>) -> Self {
81 // If the parent couldn't be allocated, just early-return
103 ) -> impl PinInit<File<T>, E> + 'a
105 T: Sync + 'static,
119 scope <- scope
132 pub fn new(name: &CStr) -> Self {
145 pub fn subdir(&self, name: &CStr) -> Self {
149 /// Creates a read-only file in this directory.
151 /// The file's contents are produced by invoking [`Writer::write`] on the value initialized by
169 ) -> impl PinInit<File<T>, E> + 'a
171 T: Writer + Send + Sync + 'static,
177 /// Creates a read-only binary file in this directory.
195 ) -> impl PinInit<File<T>, E> + 'a
197 T: BinaryWriter + Send + Sync + 'static,
202 /// Creates a read-only file in this directory, with contents from a callback.
204 /// `f` must be a function item or a non-capturing closure.
213 /// # sync::atomic::{
237 ) -> impl PinInit<File<T>, E> + 'a
239 T: Send + Sync + 'static,
240 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync,
246 /// Creates a read-write file in this directory.
254 ) -> impl PinInit<File<T>, E> + 'a
256 T: Writer + Reader + Send + Sync + 'static,
262 /// Creates a read-write binary file in this directory.
270 ) -> impl PinInit<File<T>, E> + 'a
272 T: BinaryWriter + BinaryReader + Send + Sync + 'static,
278 /// Creates a read-write file in this directory, with logic from callbacks.
282 /// `f` and `w` must be function items or non-capturing closures.
290 ) -> impl PinInit<File<T>, E> + 'a
292 T: Send + Sync + 'static,
293 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync,
294 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync,
303 /// Creates a write-only file in this directory.
313 ) -> impl PinInit<File<T>, E> + 'a
315 T: Reader + Send + Sync + 'static,
320 /// Creates a write-only binary file in this directory.
330 ) -> impl PinInit<File<T>, E> + 'a
332 T: BinaryReader + Send + Sync + 'static,
337 /// Creates a write-only file in this directory, with write logic from a callback.
339 /// `w` must be a function item or a non-capturing closure.
346 ) -> impl PinInit<File<T>, E> + 'a
348 T: Send + Sync + 'static,
349 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync,
362 fn scoped_dir<'data>(&self, name: &CStr) -> ScopedDir<'data, 'static> {
391 ) -> impl PinInit<Scope<T>, E> + 'a
414 // This order is load-bearing for drops - `_entry` must be dropped before `data`.
435 fn new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b
441 data <- data,
454 fn entry_mut(self: Pin<&mut Self>) -> &mut Entry<'static> {
459 fn new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b
461 F: for<'a> FnOnce(&'a T) -> Entry<'static> + 'b,
466 data <- data,
490 ) -> impl PinInit<Self, E> + 'a
504 fn deref(&self) -> &T {
511 fn deref(&self) -> &T {
524 _phantom: PhantomData<fn(&'data ()) -> &'dir ()>,
531 pub fn dir<'dir2>(&'dir2 self, name: &CStr) -> ScopedDir<'data, 'dir2> {
541 fn create_file<T: Sync>(&self, name: &CStr, data: &'data T, vtable: &'static FileOps<T>) {
546 /// Creates a read-only file in this directory.
548 /// The file's contents are produced by invoking [`Writer::write`].
553 pub fn read_only_file<T: Writer + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) {
557 /// Creates a read-only binary file in this directory.
563 pub fn read_binary_file<T: BinaryWriter + Send + Sync + 'static>(
571 /// Creates a read-only file in this directory, with contents from a callback.
576 /// `f` must be a function item or a non-capturing closure.
584 T: Send + Sync + 'static,
585 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync,
591 /// Creates a read-write file in this directory.
599 pub fn read_write_file<T: Writer + Reader + Send + Sync + 'static>(
608 /// Creates a read-write binary file in this directory.
615 pub fn read_write_binary_file<T: BinaryWriter + BinaryReader + Send + Sync + 'static>(
624 /// Creates a read-write file in this directory, with logic from callbacks.
628 /// `f` and `w` must be function items or non-capturing closures.
641 T: Send + Sync + 'static,
642 F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync,
643 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync,
651 /// Creates a write-only file in this directory.
658 pub fn write_only_file<T: Reader + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) {
663 /// Creates a write-only binary file in this directory.
669 pub fn write_binary_file<T: BinaryReader + Send + Sync + 'static>(
677 /// Creates a write-only file in this directory, with write logic from a callback.
681 /// `w` must be a function item or a non-capturing closure.
689 T: Send + Sync + 'static,
690 W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync,
698 fn empty() -> Self {
706 fn into_entry(self) -> Entry<'dir> {
717 fn new(name: &CStr) -> ScopedDir<'data, 'static> {