-
Notifications
You must be signed in to change notification settings - Fork 656
Open
Labels
Description
https://docs.rs/futures/latest/futures/io/struct.Take.html#method.get_ref
Acquires a reference to the underlying sink or stream that this combinator is pulling from.
These methods are defined by the delegate_access_inner macro and we need to fix that macro.
futures-rs/futures-util/src/io/take.rs
Line 81 in 0f83c20
delegate_access_inner!(inner, R, ()); |
futures-rs/futures-util/src/lib.rs
Lines 183 to 217 in 0f83c20
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. | |
pub fn 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. | |
pub fn get_mut(&mut self) -> &mut $inner { | |
(&mut self.$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. | |
pub fn get_pin_mut(self: core::pin::Pin<&mut Self>) -> 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. | |
pub fn into_inner(self) -> $inner { | |
self.$field $($ind into_inner())* | |
} | |
} | |
} |