trait Foo {
type Bar<T>
}
trait Iterator {
type Item;
fn next<'a>(&'a mut self) -> Option<Self::Item>;
// "Streaming iterator"
trait StreamingIterator {
type Item<'a>;
fn next<'a>(&'a mut self) -> Option<Self::Item<'a>>;
// "Owning ref"
struct OwnedRef<T> // today
// Deref: &'a self -> &'a T
// works for things like T = String
// but not for a type that has a lifetime
// async fn
type BlahFuture<..>
fn blah(&self) -> Self::BlahFuture<..>
trait AsyncFnMut {
type Output<'a>: Future;
fn call_mut<'a>(&'a mut self) -> Self::Output<'a>
// Consider a shortcut? Maybe, but maybe not worth it
trait Foo {
type Bar<T>
}
trait Iterator {
type Item;
fn next<'a>(&'a mut self) -> Option<Self::Item>;
}
// "Streaming iterator"
trait StreamingIterator {
type Item<'a>;
fn next<'a>(&'a mut self) -> Option<Self::Item<'a>>;
}
// "Owning ref"
struct OwnedRef<T> // today
// Deref: &'a self -> &'a T
// works for things like T = String
// but not for a type that has a lifetime
// async fn
trait Foo {
type BlahFuture<..>
fn blah(&self) -> Self::BlahFuture<..>
}
trait AsyncFnMut {
type Output<'a>: Future;
fn call_mut<'a>(&'a mut self) -> Self::Output<'a>
}
// Consider a shortcut? Maybe, but maybe not worth it