pub struct SharedFile(/* private fields */);Expand description
A file handle this crate can read/write through without the caller having to prove it outlives every operation pushed against it (M8, PR #20 review response).
Backed by Arc<OwnedHandle> rather than Token’s exclusive-ownership
shape: unlike a buffer, one handle is legitimately the target of many
concurrent pushes, so what must survive until every one of them
completes is a reference, not sole ownership. Every safe push method
(e.g. Batch::read, as opposed to its _raw sibling) clones this
Arc into the same Token that already tracks the operation’s own
payload, so the underlying handle survives until that token is claimed
or leaked (D-4 in DESIGN-NOTES.md), regardless of what the caller does
with its own clone.
Implementations§
Sourcepub fn new(handle: OwnedHandle) -> Self
pub fn new(handle: OwnedHandle) -> Self
Wrap an owned handle so it can be read/written through the ring safely.
Trait Implementations§
Source§fn clone(&self) -> SharedFile
fn clone(&self) -> SharedFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more