pub struct AnyContextSource { /* private fields */ }Expand description
A type-erased ContextSource, so an agent can hold a heterogeneous set.
Boxing lives entirely inside this wrapper: the methods it exposes return
impl Future exactly like the trait they stand in for.
Implementations§
Source§impl AnyContextSource
impl AnyContextSource
Sourcepub fn new<T: ContextSource>(source: T) -> Self
pub fn new<T: ContextSource>(source: T) -> Self
Erases the concrete type of source.
Sourcepub fn id(&self) -> SourceId
pub fn id(&self) -> SourceId
See ContextSource::id.
Sourcepub fn blocks(
&mut self,
moment: Moment,
) -> impl Future<Output = Vec<ContextBlock>> + Send + '_
pub fn blocks( &mut self, moment: Moment, ) -> impl Future<Output = Vec<ContextBlock>> + Send + '_
Sourcepub fn peek(
&self,
moment: Moment,
) -> impl Future<Output = Vec<ContextBlock>> + Send + '_
pub fn peek( &self, moment: Moment, ) -> impl Future<Output = Vec<ContextBlock>> + Send + '_
See ContextSource::peek.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AnyContextSource
impl !UnwindSafe for AnyContextSource
impl Forget for AnyContextSource
impl Freeze for AnyContextSource
impl Move for AnyContextSource
impl Send for AnyContextSource
impl Sync for AnyContextSource
impl Unpin for AnyContextSource
impl UnsafeUnpin for AnyContextSource
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