pub struct StreamIoConnection<T: 'static + File + GetVmo> { /* private fields */ }
Expand description
Wrapper around a file that forwards File
requests to file
and
FileIo
requests to stream
.
Implementations§
Source§impl<T: 'static + File + GetVmo> StreamIoConnection<T>
impl<T: 'static + File + GetVmo> StreamIoConnection<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 stream-based file connection. A stream based file connection sends a zx::stream to
clients that can be used for issuing read, write, and seek calls. Any read, write, and seek
calls that continue to come in over FIDL will be forwarded to stream
instead of being sent
to file
.
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 + GetVmo> ConnectionCreator<T> for StreamIoConnection<T>
impl<T: 'static + File + GetVmo> ConnectionCreator<T> for StreamIoConnection<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.Auto Trait Implementations§
impl<T> Freeze for StreamIoConnection<T>
impl<T> RefUnwindSafe for StreamIoConnection<T>where
T: RefUnwindSafe,
impl<T> Send for StreamIoConnection<T>
impl<T> Sync for StreamIoConnection<T>
impl<T> Unpin for StreamIoConnection<T>
impl<T> UnwindSafe for StreamIoConnection<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