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.
pub async fn create_with_stream( scope: ExecutionScope, file: Arc<T>, stream: Stream, options: impl ToFileOptions, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>
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§fn create<'a>(
scope: ExecutionScope,
node: Arc<T>,
protocols: impl ProtocolsExt,
object_request: ObjectRequestRef<'a>,
) -> impl Future<Output = Result<(), Status>> + 'a
fn create<'a>( scope: ExecutionScope, node: Arc<T>, protocols: impl ProtocolsExt, object_request: ObjectRequestRef<'a>, ) -> impl Future<Output = Result<(), Status>> + 'a
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
OpenNode<T>: RefUnwindSafe,
impl<T> Send for StreamIoConnection<T>
impl<T> Sync for StreamIoConnection<T>
impl<T> Unpin for StreamIoConnection<T>
impl<T> UnsafeUnpin for StreamIoConnection<T>where
OpenNode<T>: UnsafeUnpin,
impl<T> UnwindSafe for StreamIoConnection<T>where
OpenNode<T>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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