pub struct FidlIoConnection<T: 'static + File> { /* private fields */ }
Expand description
Wrapper around a file that manages the seek offset of the connection and transforms IoOpHandler
requests into FileIo
requests. All File
requests are forwarded to file
.
Implementations§
Source§impl<T: 'static + File + FileIo> FidlIoConnection<T>
impl<T: 'static + File + FileIo> FidlIoConnection<T>
Sourcepub async fn create(
scope: ExecutionScope,
file: Arc<T>,
options: impl ToFileOptions,
object_request: ObjectRequestRef<'_>,
) -> Result<(), Status>
pub async fn create( scope: ExecutionScope, file: Arc<T>, options: impl ToFileOptions, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>
Creates a new connection to serve the file that uses FIDL for all IO. The file will be
served from a new async Task
, not from the current Task
. Errors in constructing the
connection are not guaranteed to be returned, they may be sent directly to the client end of
the connection. This method should be called from within an ObjectRequest
handler to
ensure that errors are sent to the client end of the connection.
Sourcepub fn create_sync(
scope: ExecutionScope,
file: Arc<T>,
options: impl ToFileOptions,
object_request: ObjectRequest,
)
pub fn create_sync( scope: ExecutionScope, file: Arc<T>, options: impl ToFileOptions, object_request: ObjectRequest, )
Similar to create
but optimized for files whose implementation is synchronous and
creating the connection is being done from a non-async context.
Trait Implementations§
Source§impl<T: 'static + File + FileIo> ConnectionCreator<T> for FidlIoConnection<T>
impl<T: 'static + File + FileIo> ConnectionCreator<T> for FidlIoConnection<T>
Source§async fn create<'a>(
scope: ExecutionScope,
node: Arc<T>,
protocols: impl ProtocolsExt,
object_request: ObjectRequestRef<'a>,
) -> Result<(), Status>
async fn create<'a>( scope: ExecutionScope, node: Arc<T>, protocols: impl ProtocolsExt, object_request: ObjectRequestRef<'a>, ) -> Result<(), Status>
Creates a new connection to
node
and spawns a new Task
to run the connection.Source§impl<T: 'static + File> Deref for FidlIoConnection<T>
impl<T: 'static + File> Deref for FidlIoConnection<T>
Auto Trait Implementations§
impl<T> Freeze for FidlIoConnection<T>
impl<T> RefUnwindSafe for FidlIoConnection<T>where
T: RefUnwindSafe,
impl<T> Send for FidlIoConnection<T>
impl<T> Sync for FidlIoConnection<T>
impl<T> Unpin for FidlIoConnection<T>
impl<T> UnwindSafe for FidlIoConnection<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more