pub struct WindowsBackend<B: IoBuf, R: IoBufMut = Vec<u8>> { /* private fields */ }Expand description
The Windows backend: an IoRing and the targets it runs I/O for. B is the owned buffer type
and R the registered buffers’.
Write-only buffer types (DI-D-17): an owned write needs only B: IoBuf, so a type such as Arc<[u8]> can be written. An owned read
needs B: IoBufMut, and is pushed through a push made where that bound holds: new
makes it, without_owned_reads does not, and an owned read on a
backend without it is refused as RefusalCause::Unsupported.
Implementations§
Source§impl<B: IoBufMut, R: IoBufMut> WindowsBackend<B, R>
impl<B: IoBufMut, R: IoBufMut> WindowsBackend<B, R>
Sourcepub fn new(
setup: WindowsBackendSetup<R>,
) -> Result<Self, WindowsBackendError<R>>
pub fn new( setup: WindowsBackendSetup<R>, ) -> Result<Self, WindowsBackendError<R>>
A ring with setup’s queue sizes, its targets and buffers registered, and its completion
event attached, which reads into owned buffers as well as writing from them.
§Errors
WindowsBackendError, handing back the targets and, where it can, the buffers.
Source§impl<B: IoBuf, R: IoBufMut> WindowsBackend<B, R>
impl<B: IoBuf, R: IoBufMut> WindowsBackend<B, R>
Sourcepub fn without_owned_reads(
setup: WindowsBackendSetup<R>,
) -> Result<Self, WindowsBackendError<R>>
pub fn without_owned_reads( setup: WindowsBackendSetup<R>, ) -> Result<Self, WindowsBackendError<R>>
As new, for a buffer type that may be only IoBuf: it writes from
owned buffers and reads into registered ones, and refuses an owned read as
RefusalCause::Unsupported (DI-D-17).
§Errors
WindowsBackendError, handing back the targets and, where it can, the buffers.
Sourcepub fn target(&self, key: IoTargetKey) -> Option<&Win32FileTarget>
pub fn target(&self, key: IoTargetKey) -> Option<&Win32FileTarget>
The target under key, if there is one.
Sourcepub fn registered_buffer(&mut self, index: u32) -> Result<&[u8]>
pub fn registered_buffer(&mut self, index: u32) -> Result<&[u8]>
Registered buffer index’s bytes.
§Errors
For a backend built without registered buffers, or an index out of range.
Sourcepub fn registered_buffer_mut(&mut self, index: u32) -> Result<&mut [u8]>
pub fn registered_buffer_mut(&mut self, index: u32) -> Result<&mut [u8]>
Trait Implementations§
Source§impl<B: IoBuf, R: IoBufMut> IoBackend for WindowsBackend<B, R>
impl<B: IoBuf, R: IoBufMut> IoBackend for WindowsBackend<B, R>
Source§type Target = Win32FileTarget
type Target = Win32FileTarget
Source§type Notification = CompletionEvent
type Notification = CompletionEvent
Source§fn attach(
&mut self,
key: IoTargetKey,
target: Win32FileTarget,
) -> Result<(), DuplicateTarget<Win32FileTarget>>
fn attach( &mut self, key: IoTargetKey, target: Win32FileTarget, ) -> Result<(), DuplicateTarget<Win32FileTarget>>
Source§fn detach(&mut self, key: IoTargetKey) -> Option<Win32FileTarget>
fn detach(&mut self, key: IoTargetKey) -> Option<Win32FileTarget>
key, handing it back; None if there is none. A
submission for it queued but not yet submitted still completes exactly once, through
pop: with a fault, or, for a backend that cannot take a queued submission
back, issued as it would have been, to the file it was pushed for. The core detaches a
target only with no operation outstanding, so a driver does not meet either.Source§fn registered_buffers(&self) -> u32
fn registered_buffers(&self) -> u32
RegisteredRegion names one by its position.Source§fn check(
&self,
target: IoTargetKey,
op: &SubmissionOp<B>,
) -> Result<(), RefusalCause>
fn check( &self, target: IoTargetKey, op: &SubmissionOp<B>, ) -> Result<(), RefusalCause>
push would refuse op on target for a cause that does not depend
on its queues: no target under the key, an operation it cannot perform, or one malformed for
its target. The core asks before it holds an operation for its gate, so a gated operation is
refused at the consumer’s push for what an ungated one would be (DI-D-54). A push this
accepts may still be refused for a full queue, or by a backend that has become unusable. Read more