#[cfg(all(feature = "bilock", not(feature = "unstable")))]
compile_error!("The `bilock` feature requires the `unstable` feature as an explicit opt-in to unstable features");
macro_rules! delegate_access_inner {
($field:ident, $inner:ty, ($($ind:tt)*)) => { /// Acquires a reference to the underlying sink or stream that this combinator is /// pulling from. pubfn get_ref(&self) -> &$inner {
(&self.$field) $($ind get_ref())*
}
/// Acquires a mutable reference to the underlying sink or stream that this /// combinator is pulling from. /// /// Note that care must be taken to avoid tampering with the state of the /// sink or stream which may otherwise confuse this combinator. pubfn get_mut(&mutself) -> &mut $inner {
(&mutself.$field) $($ind get_mut())*
}
/// Acquires a pinned mutable reference to the underlying sink or stream that this /// combinator is pulling from. /// /// Note that care must be taken to avoid tampering with the state of the /// sink or stream which may otherwise confuse this combinator. pubfn get_pin_mut(self: core::pin::Pin<&mutSelf>) -> core::pin::Pin<&mut $inner> { self.project().$field $($ind get_pin_mut())*
}
/// Consumes this combinator, returning the underlying sink or stream. /// /// Note that this may discard intermediate state of this combinator, so /// care should be taken to avoid losing resources when this is called. pubfn into_inner(self) -> $inner { self.$field $($ind into_inner())*
}
}
}
macro_rules! delegate_all {
(@trait Future $name:ident < $($arg:ident),* > ($t:ty) $(where $($bound:tt)*)*) => { impl<$($arg),*> futures_core::future::Future for $name<$($arg),*> where $t: futures_core::future::Future $(, $($bound)*)* { type Output = <$t as futures_core::future::Future>::Output;
delegate_future!(inner);
}
};
(@trait FusedFuture $name:ident < $($arg:ident),* > ($t:ty) $(where $($bound:tt)*)*) => { impl<$($arg),*> futures_core::future::FusedFuture for $name<$($arg),*> where $t: futures_core::future::FusedFuture $(, $($bound)*)* { fn is_terminated(&self) -> bool { self.inner.is_terminated()
}
}
};
(@trait Stream $name:ident < $($arg:ident),* > ($t:ty) $(where $($bound:tt)*)*) => { impl<$($arg),*> futures_core::stream::Stream for $name<$($arg),*> where $t: futures_core::stream::Stream $(, $($bound)*)* { type Item = <$t as futures_core::stream::Stream>::Item;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.