Skip to main content

Backend

Struct Backend 

Source
pub struct Backend;

Implementations§

Trait Implementations§

Source§

impl Completion for Backend

Source§

type Outcome = Outcome

Source§

type Invalid = Invalid

Source§

unsafe fn open( raw: <Backend as Completion>::Outcome, ) -> Result<Result<OwnedFd, Errno>, <Backend as Completion>::Invalid>

Safety Read more
Source§

impl Control for Backend

Source§

type Target = Fixed

Source§

type Owned<T: Token> = Owned<T>

Source§

type Poll<'a, T: Token> = Poll<'a, T>

Source§

fn nop<T>(complete: T) -> <Backend as Control>::Owned<T>
where T: Token,

Source§

fn close<T>( slot: <Backend as Control>::Target, complete: T, ) -> <Backend as Control>::Owned<T>
where T: Token,

Source§

fn shutdown<T>( slot: <Backend as Control>::Target, complete: T, ) -> <Backend as Control>::Owned<T>
where T: Token,

First step of a hard-linked close, suppressing its successful completion.
Source§

impl<C, G> Create<C, G> for Backend
where C: Config<G>, <C as Context>::Layout: Canary, <<C as Context>::Token as Codec>::Context: Build<Errno<Register<6>>>, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary: From<Primary<Cause<Errno<Setup>, Errno<Map>>, Errno<Register<20>>, Errno<Register<22>>>> + From<Error> + From<Rejection<Errno<Register<24>>, Errno<Register<13>>, Errno<Register<25>>>>, Session<<C as Context>::Token, <C as Context>::Layout>: Create<<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, Ring = Ring<<C as Context>::Token>, Cleanup = Resources<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary>> + Validate<<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed, Update = Errno<Register<6>>, Cleanup = Result<<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, Recover<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary>>, Release = Result<(<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed, Fixed), Released<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed>>>, Ring<<C as Context>::Token>: Validate<<C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, Probe = <<<C as Context>::Token as Codec>::Context as Context>::Probe, Cleanup = Result<<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, Recover<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary>>> + Validate<<C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed, Range = Range, Probe = <<<C as Context>::Token as Codec>::Context as Context>::Probe, Update = Errno<Register<6>>, Cleanup = Result<<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, Recover<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary>>, Release = Result<(<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed, Fixed), Released<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed>>>,

Source§

type Receive = <Backend as Source>::Queue<<C as Config<G>>::Key, <C as Config<G>>::Index>

Source§

type Error = Failure<<Ring<<C as Context>::Token> as Create>::Setup, <Ring<<C as Context>::Token> as Create>::Map, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary, Resources<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Primary>, Result<(<<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed, Fixed), Released<<C as Context>::Token, <C as Context>::Layout, <<<C as Context>::Token as Codec>::Context as Build<Errno<Register<6>>>>::Removed>>>

Source§

unsafe fn try_new( config: &G, ) -> Result<(Engine<C>, Context<<C as Context>::Layout>, <Backend as Source>::Queue<<C as Config<G>>::Key, <C as Config<G>>::Index>), <Backend as Create<C, G>>::Error>

Safety Read more
Source§

impl Debug for Backend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Directory for Backend

Source§

type Stream = Stream

Source§

type Watch = Watch

Source§

type Events<'a> = Events<'a>

Source§

unsafe fn watch_events<'a>( _: &<Backend as Directory>::Watch, bytes: &'a [u8], ) -> <Backend as Directory>::Events<'a>

Safety Read more
Source§

fn from_fd<E>(file: OwnedFd) -> Result<Stream, OpenError<E>>
where E: From<Errno>,

Source§

fn descriptor(stream: &Stream) -> Descriptor

Source§

fn next(stream: &mut Stream) -> Result<Option<Entry<'_>>, Errno>

Source§

fn open_dir<E>(path: &CStr) -> Result<Self::Stream, OpenError<E>>
where E: From<Errno>, Self: File,

Source§

impl File for Backend

Source§

type Options = OpenHow

Source§

type Metadata = Metadata

Source§

type Request<'a> = Borrowed<'a>

Source§

fn open<E>(path: &CStr, flags: Open, mode: Mode) -> Result<OwnedFd, E>
where E: From<Errno>,

Source§

fn metadata<E>(file: BorrowedFd<'_>) -> Result<Metadata, E>
where E: From<Errno>,

Source§

fn stat<E>(path: &CStr) -> Result<Metadata, E>
where E: From<Errno>,

Source§

fn mkdir<E>(path: &CStr, mode: Mode) -> Result<(), E>
where E: From<Errno>,

Source§

fn metadata_at<E>( dir: Option<BorrowedFd<'_>>, name: &CStr, ) -> Result<Metadata, E>
where E: From<Errno>,

Classifies the named entry itself while retaining its parent directory.
Source§

fn rename<E>(from: &CStr, to: &CStr) -> Result<(), E>
where E: From<Errno>,

Source§

fn try_lock<E>(file: BorrowedFd<'_>) -> Result<(), E>
where E: From<Errno>,

Attempts an exclusive advisory lock without waiting for its current owner.
Source§

fn sync<E>(file: BorrowedFd<'_>) -> Result<(), E>
where E: From<Errno>,

Source§

fn truncate<E>(file: BorrowedFd<'_>, len: i64) -> Result<(), E>
where E: From<Errno>,

Source§

fn rmdir_at<E>(dir: Option<BorrowedFd<'_>>, name: &CStr) -> Result<(), E>
where E: From<Errno>,

Source§

fn open_at<E>( dir: BorrowedFd<'_>, name: &CStr, flags: Open, mode: Mode, ) -> Result<OwnedFd, E>
where E: From<Errno>,

Source§

fn rename_at<E>(dir: BorrowedFd<'_>, old: &CStr, new: &CStr) -> Result<(), E>
where E: From<Errno>,

Source§

fn read_at<'a, E>( file: BorrowedFd<'_>, output: &'a mut [u8], offset: Offset, ) -> Result<&'a mut [u8], E>
where E: From<Errno>,

Reads one prefix without changing the descriptor’s current position.
Source§

fn write_at<E>( file: BorrowedFd<'_>, input: Prefix<'_, dope_sys::::io::file::File::write_at::{constant#2}>, offset: Offset, ) -> Result<U32<0, dope_sys::::io::file::File::write_at::{constant#1}>, E>
where E: From<Errno>,

Source§

impl Native for Backend

Source§

impl<T, S, F> Observe<T, S, F> for Backend
where T: Copy + Eq, S: Copy + Eq, F: Copy + Eq,

Source§

type Observation = Parts<T, Outcome, Flags>

Source§

impl Pipe for Backend

Source§

impl Prepare for Backend

Source§

type Handle = OwnedFd

Source§

type Fast = NonZero<i32>

Source§

fn fast_open( depth: Option<NonZero<i32>>, ) -> Result<Option<<Backend as Prepare>::Fast>, Error>

Source§

fn open( domain: Domain, kind: Kind, ) -> Result<<Backend as Prepare>::Handle, Create>

Source§

fn listener(domain: Domain) -> Result<<Backend as Prepare>::Handle, Create>

Source§

fn adopt(file: OwnedFd) -> Result<<Backend as Prepare>::Handle, Setup>

Source§

fn into_fd(handle: <Backend as Prepare>::Handle) -> OwnedFd

Transfers the prepared socket’s descriptor without changing its native configuration.
Source§

fn set_fast( file: BorrowedFd<'_>, fast: <Backend as Prepare>::Fast, ) -> Result<(), Errno>

Source§

impl Removal for Backend

Source§

impl Socket for Backend

Source§

const MAX_IOVECS: usize

Source§

type Error = Errno

Source§

fn socket(domain: i32, kind: i32) -> Result<OwnedFd, <Backend as Socket>::Error>

Source§

fn pair() -> Result<(OwnedFd, OwnedFd), Error>

Creates exclusively owned local socket endpoints.
Source§

fn datagram<E>(domain: Domain) -> Result<OwnedFd, E>
where E: From<Errno>,

Creates one datagram descriptor without changing its descriptor flags.
Source§

fn try_open<E>(domain: i32, kind: i32, protocol: i32) -> Result<OwnedFd, E>
where E: From<Errno>,

Source§

fn listen<E>(file: BorrowedFd<'_>, backlog: i32) -> Result<(), E>
where E: From<Errno>,

Source§

fn shutdown<E>(file: BorrowedFd<'_>, how: How) -> Result<(), E>
where E: From<Errno>,

Half-closes one socket in the requested direction.
Source§

fn peer_addr<E>(file: BorrowedFd<'_>, address: &mut Storage) -> Result<(), E>
where E: From<Errno>,

Observes the connected peer into caller-owned native address storage.
Source§

fn send_quiet<'a, E>( file: BorrowedFd<'_>, input: &'a [u8], ) -> Result<&'a [u8], E>
where E: From<Errno>,

Sends one byte string without raising the termination signal.
Source§

fn send_now<'a, E>(file: BorrowedFd<'_>, input: &'a [u8]) -> Result<&'a [u8], E>
where E: From<Errno>,

Sends without waiting or raising the termination signal.
Source§

fn send<'a, const FLAGS: i32, E>( file: BorrowedFd<'_>, input: &'a [u8], ) -> Result<&'a [u8], E>
where E: From<Errno>,

Source§

fn recv<'a, const FLAGS: i32, E>( file: BorrowedFd<'_>, output: &'a mut [u8], ) -> Result<&'a mut [u8], E>
where E: From<Errno>,

Source§

fn recv_now<'a, E>( file: BorrowedFd<'_>, output: &'a mut [u8], ) -> Result<&'a mut [u8], E>
where E: From<Errno>,

Source§

fn send_to<'a, E>( file: BorrowedFd<'_>, input: &'a [u8], address: Addr<'_>, ) -> Result<&'a [u8], E>
where E: From<Errno>,

Sends one datagram to the retained native destination.
Source§

fn recv_from<'a, E>( file: BorrowedFd<'_>, output: &'a mut [u8], address: &mut Storage, ) -> Result<&'a mut [u8], E>
where E: From<Errno>,

Receives one datagram and its source into caller-owned storage.
Source§

impl Source for Backend

Source§

const MAX_IN_FLIGHT: NonZero<usize> = num::NonZero<usize>::MAX

Maximum simultaneous native accept operations on one listener.
Source§

type Failure<F: From<Errno>> = Errno

Source§

fn is_retryable(error: Errno) -> bool

Whether one native accept failure permits another attempt on the listener. Resource exhaustion never permits an unconditional retry; retain its exact error.
Source§

fn can_defer(error: Errno) -> bool

Whether actual descriptor retirement permits one later attempt after this error. This does not establish a pending retirement or identify the error’s origin.
Source§

impl Source for Backend

Source§

const LIMITS: Option<(U32<1, dope_uring::::backend::{impl#5}::LIMITS::{constant#1}>, U32<2, dope_uring::::backend::{impl#5}::LIMITS::{constant#3}>)>

Source§

type Mode = Control

Source§

impl Source for Backend

Source§

type Code = Code

Source§

type Failure<S: Copy + Eq> = Failure<S>

Source§

type Returned = Returned

Source§

impl Source for Backend

Source§

type Queue<K: Key, I: Compact> = Fifo<K, I>

Source§

impl Source for Backend

Source§

const PROVIDED: u16 = 1

Source§

const CANARY: u16 = 2

Source§

type Index = Buffer

Source§

type Context<L: Receive> = Context<L>

Source§

type Canary<L: Canary> = Canary<L>

Source§

type Producer<L: Receive> = Producer<L>

Source§

type Pending<E: Extent> = Selected<E, <E as Extent>::Capacity>

Source§

type Complete<E: Extent> = Selected<E, <E as Extent>::Length>

Source§

impl Source for Backend

Source§

const UNIX_TERMINATED: bool = false

Whether every pathname must retain a trailing NUL inside the path field.
Source§

const UNIX_ABSTRACT: bool = true

Whether a leading NUL selects the native abstract namespace.
Source§

fn header(domain: Domain, _: Socklen) -> [u8; 2]

Source§

impl Source for Backend

Source§

const KEEP_IDLE: i32 = libc::TCP_KEEPIDLE

Source§

type Listening = Errno

Source§

fn is_listening( file: BorrowedFd<'_>, ) -> Result<bool, <Backend as Source>::Listening>

Whether one adopted descriptor is already listening.
Source§

fn reset<E>(file: impl AsFd) -> Result<(), E>
where E: From<Errno>,

Makes closing this exclusively owned connection send a reset.
Source§

fn kind<E>(file: BorrowedFd<'_>) -> Result<Type, E>
where E: From<Errno>,

Observes the socket type of one adopted descriptor.
Source§

fn set_reuse<E>(file: BorrowedFd<'_>, reuse: Reuse) -> Result<(), E>
where E: From<Errno>,

Admits the requested address reuse on one socket.
Source§

fn get_option<const OPTION: i32, E>(file: BorrowedFd<'_>) -> Result<i32, E>
where E: From<Errno>,

Source§

fn set_option<E>( file: BorrowedFd<'_>, level: i32, option: i32, value: &i32, ) -> Result<(), E>
where E: From<Errno>,

Source§

fn option(kind: Kind) -> (i32, i32)

Source§

fn set(fd: BorrowedFd<'_>, kind: Kind, value: &Value) -> Result<(), Errno>

Source§

impl Source for Backend

Source§

type State<E: Copy, const N: usize> = State<E, N>

Source§

type Table<E: Copy, const N: usize> = Table<E, N>

Source§

impl Source for Backend

Source§

type Ready<T: Token, L: Receive> = Ready<T, L>

Source§

type Poll = Poll<Errno<Enter>, Errno<Register<24>>>

Source§

type Enter<'a, T: 'a> = Enter<'a, T>

Source§

type Entry<T> = Entry<T>

Source§

type Message<'a, const NAME: usize, const CONTROL: usize> = Output<'a, NAME, CONTROL>

Source§

type Ring<T: Token> = Ring<T>

Source§

impl Source for Backend

Source§

type Range = Range

Source§

type Release<T: Codec, L: Canary, P: Copy> = Released<T, L, P>

Source§

type Cleanup<T: Codec, L: Canary, P: Copy> = Recover<T, L, P>

Source§

type Payload = Payload

Source§

type Accept<T: Codec> = Accepted<T>

Source§

type Session<T: Codec, L: Canary> = Session<T, L>

Source§

type Outcome<T: Token, P: Copy> = Outcome<T, P>

Source§

type Waiting<T: Codec, S> = Waiting<S, T>

Source§

impl Source for Backend

Source§

type Primary = Primary<Cause<Errno<Setup>, Errno<Map>>, Errno<Register<20>>, Errno<Register<22>>>

Source§

type Failure<T: Codec> = Failure<Storage<Errno<Unmap>>, Cause<<<T as Codec>::Context as Context>::Probe, Parts<T, Outcome, Flags>, Errno<Enter>>>

Source§

type Resources<T: Codec, L: Canary, P: Copy + From<<Backend as Source>::Primary> + From<Error>> = Resources<T, L, P>

Source§

impl Source for Backend

Source§

type Token<C: Context> = Encoded<C>

Source§

impl Source for Backend

Source§

const STORAGE: <Backend as Source>::Storage

Source§

type Storage = [sock_filter; 228]

Source§

type Install<'a> = Installer<'a>

Source§

type Ready = ()

Source§

type Lease<'a> = BorrowedFd<'a>

Source§

fn try_prepare( filter: &mut <Backend as Source>::Storage, plan: Plan, ) -> Result<(<Backend as Source>::Install<'_>, <Backend as Source>::Ready), Plan>

Source§

fn lease<'a>(_: &(), socket: BorrowedFd<'a>) -> <Backend as Source>::Lease<'a>

Source§

impl Source for Backend

Source§

type Control = Source

Source§

type Combined = Combined

Owns the selected source and exactly the optional segmentation capability supplied.
Source§

fn compose(source: Source, gso: Option<Control>) -> Combined

Source§

fn release(control: Combined) -> (Source, Option<Control>)

Source§

fn source( bind: SocketAddr, peer: SocketAddr, ) -> Result<(Address, Self::Control), Error>

Preserves an explicit source; resolves wildcard binds once on a separate socket.
Source§

impl Source for Backend

Source§

fn read() -> i32

Reads this thread’s unchanged native errno slot.
Source§

impl Source for Backend

Source§

impl<C> Source<C> for Backend
where C: Context,

Source§

type Backend = Engine<C>

Source§

type Closing = <Engine<C> as Close>::State

Source§

impl<C> Source<C> for Backend
where C: Context,

Source§

type Target = Fixed

Source§

fn target(slot: <C as Context>::Target) -> Fixed

Source§

impl<C, L, P, R> Storage<C, L, P, R> for Backend
where C: Context, L: Canary, P: Copy + From<Primary<Cause<Errno<Setup>, Errno<Map>>, Errno<Register<20>>, Errno<Register<22>>>> + From<Error>, R: Copy,

Source§

type Cleanup = <Backend as Source>::Resources<Encoded<C>, L, P>

Source§

type Release = <Backend as Source>::Release<Encoded<C>, L, R>

Source§

impl Thread for Backend

Source§

type Timer = Timer

Source§

type Receiver = Receiver

Source§

type Cpus = Cpus

Source§

fn current() -> Result<<Backend as Thread>::Cpus, Error>

Source§

fn bind(cpu: Cpu) -> Result<(), Error>

Source§

fn crc32() -> Option<bool>

Returns hardware admission, or None when the operating system must be queried.
Source§

fn entropy<const N: usize>( bytes: &mut MaybeUninit<[u8; N]>, ) -> Result<&mut [u8; N], Errno>

Initializes N caller-owned bytes from the operating system; N must not exceed 256.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<L, R> Convert<Either<L, R>, 1> for L

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<L, R> Convert<Either<L, R>, 2> for R

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<T> Convert<T> for T

Source§

fn into(self) -> T

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<T> Fd for T
where T: Source,

Source§

fn try_limit() -> Result<(u64, u64), Errno>

Source§

fn update<E>(file: BorrowedFd<'_>) -> Result<(), E>
where E: Flags,

Adds a descriptor flag, retrying only each interrupted native attempt.
Source§

fn remove<E>(file: BorrowedFd<'_>) -> Result<(), E>
where E: Flags,

Removes one descriptor flag, preserving all other native flags.
Source§

fn try_update<E>(file: BorrowedFd<'_>) -> Result<(), E>
where E: Flags,

Adds a descriptor flag with one get attempt followed by one set attempt.
Source§

fn close<E>(file: OwnedFd) -> Result<(), E>
where E: From<Errno>,

Consumes descriptor ownership through one native close attempt. The returned errno is observable; ownership is never issued for a retry.
Source§

fn duplicate<E>(file: BorrowedFd<'_>) -> Result<OwnedFd, E>
where E: From<Errno>,

Source§

fn set<const COMMAND: i32, E>(file: BorrowedFd<'_>, flags: i32) -> Result<(), E>
where E: From<Errno>,

Source§

fn set_retry<const COMMAND: i32, E>( file: BorrowedFd<'_>, flags: i32, ) -> Result<(), E>
where E: From<Errno>,

Applies scalar descriptor flags, retrying only interrupted attempts.
Source§

fn read<'a, E>( file: BorrowedFd<'_>, output: &'a mut [u8], ) -> Result<&'a mut [u8], E>
where E: From<Errno>,

Source§

fn write<'a, E>(file: BorrowedFd<'_>, input: &'a [u8]) -> Result<&'a [u8], E>
where E: From<Errno>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Poll for T
where T: Source,

Source§

fn wait<'a, 'fd, T, E>( owner: &'a mut T, timeout: i32, ) -> Result<Events<'a, 'fd>, E>
where 'fd: 'a, T: Entries<'fd>, E: From<Errno>,

Source§

impl<T> Source for T
where T: Source,

Source§

fn try_pair(kind: i32) -> Result<(OwnedFd, OwnedFd), Error>

Source§

fn accept<E>( file: BorrowedFd<'_>, addr: Option<&mut Storage>, ) -> Result<OwnedFd, E>
where E: From<Errno>,

Source§

unsafe fn send<X, E>( file: BorrowedFd<'_>, ptr: *const u8, len: <X as Extent>::Length, ) -> Result<<X as Extent>::Length, E>
where X: Extent, E: From<Errno>,

Safety Read more
Source§

unsafe fn sendmsg<E>( file: BorrowedFd<'_>, header: &Header, flags: i32, ) -> Result<U32<0, dope_sys::::io::socket::raw::Source::sendmsg::{constant#1}>, E>
where E: From<Errno>,

Safety Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.