Type Alias bevy::asset::BoxedFuture
pub type BoxedFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a, Global>>;
Expand description
An owned and dynamically typed Future used when you can’t statically type your result or need to add some indirection.
Aliased Type§
struct BoxedFuture<'a, T> { /* private fields */ }
Trait Implementations§
§impl<P> AsyncBufRead for Pin<P>where
P: DerefMut + Unpin,
<P as Deref>::Target: AsyncBufRead,
impl<P> AsyncBufRead for Pin<P>where P: DerefMut + Unpin, <P as Deref>::Target: AsyncBufRead,
§impl<P> AsyncRead for Pin<P>where
P: DerefMut + Unpin,
<P as Deref>::Target: AsyncRead,
impl<P> AsyncRead for Pin<P>where P: DerefMut + Unpin, <P as Deref>::Target: AsyncRead,
§impl<P> AsyncWrite for Pin<P>where
P: DerefMut + Unpin,
<P as Deref>::Target: AsyncWrite,
impl<P> AsyncWrite for Pin<P>where P: DerefMut + Unpin, <P as Deref>::Target: AsyncWrite,
§fn poll_write(
self: Pin<&mut Pin<P>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut Pin<P>>, cx: &mut Context<'_>, buf: &[u8] ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf
into the object. Read more§fn poll_write_vectored(
self: Pin<&mut Pin<P>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut Pin<P>>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>] ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
bufs
into the object using vectored
IO operations. Read more1.33.0 · source§impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>where
A: Allocator + 'static,
T: ?Sized,
impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>where A: Allocator + 'static, T: ?Sized,
source§fn from(boxed: Box<T, A>) -> Pin<Box<T, A>>
fn from(boxed: Box<T, A>) -> Pin<Box<T, A>>
Converts a Box<T>
into a Pin<Box<T>>
. If T
does not implement Unpin
, then
*boxed
will be pinned in memory and unable to be moved.
This conversion does not allocate on the heap and happens in place.
This is also available via Box::into_pin
.
Constructing and pinning a Box
with <Pin<Box<T>>>::from(Box::new(x))
can also be written more concisely using Box::pin(x)
.
This From
implementation is useful if you already have a Box<T>
, or you are
constructing a (pinned) Box
in a different way than with Box::new
.