// TODO: proxy/forward implementations
//
// Marker (derive):
// - Copy [derive]
// - Clone [derive]
// - Default [derive]
//
// Formatting:
// - Debug [derive]
// - Display
// - Binary
// - LowerHex
// - UpperHex
// - Octal
// - LowerExp
// - UpperExp
// - Pointer
//
// Equality / Ordering (derive):
// - PartialEq [derive]
// - Eq [derive]
// - PartialOrd [derive]
// - Ord [derive]
// - Hash [derive]
//
// Conversion:
// - From
// - TryFrom
// - FromStr
// - AsRef
// - AsMut
// - Borrow
// - BorrowMut
// - Deref
// - DerefMut
//
// Operators:
// - Add
// - Sub
// - Mul
// - Div
// - Rem
// - Neg
// - Not
// - BitAnd
// - BitOr
// - BitXor
// - Shl
// - Shr
// - AddAssign
// - SubAssign
// - MulAssign
// - DivAssign
// - RemAssign
// - BitAndAssign
// - BitOrAssign
// - BitXorAssign
// - ShlAssign
// - ShrAssign
//
// Indexing:
// - Index
// - IndexMut
//
// Iteration:
// - Iterator
// - DoubleEndedIterator
// - ExactSizeIterator
// - FusedIterator
// - IntoIterator
// - Extend
// - FromIterator
//
// Async:
// - Future
// - IntoFuture
//
// I/O:
// - Read
// - BufRead
// - Write
// - Seek
//
// Misc:
// - Error
// - Termination
//
// Probably not worth supporting:
// - Fn
// - FnMut
// - FnOnce
//
// Automatic (do not implement):
// - Send
// - Sync
// - Unpin
// - UnwindSafe
// - RefUnwindSafe
//
// Never proxy:
// - Drop
// - Any
// - Sized
// TODO: common inherent API forwarding
//
// Constructors / extraction:
// - pub const fn new(inner: T) -> Self
// - pub fn into_inner(self) -> T
// - pub fn as_inner(&self) -> &T
// - pub fn as_inner_mut(&mut self) -> &mut T
// - pub fn into_parts(self) -> T // alias of into_inner
//
// References / pointers:
// - pub fn as_ref(&self) -> &T
// - pub fn as_mut(&mut self) -> &mut T
//
// Pin projection:
// - pub fn as_pin_ref(self: Pin<&Self>) -> Pin<&T>
// - pub fn as_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>
//
// Borrowing:
// - pub fn borrow(&self) -> &T
// - pub fn borrow_mut(&mut self) -> &mut T
//
// Ownership helpers:
// - pub fn map<U>(self, f: impl FnOnce(T) -> U) -> New<U>
// - pub fn inspect(self, f: impl FnOnce(&T)) -> Self
// - pub fn replace(&mut self, value: T) -> T
// - pub fn take(&mut self) -> T // where T: Default
//
// Delegated associated constructors (opt-in):
// - pub fn with_capacity(...)
// - pub fn capacity(...)
// - pub fn reserve(...)
// - pub fn reserve_exact(...)
// - pub fn shrink_to(...)
// - pub fn shrink_to_fit(...)
//
// Delegated accessors (opt-in):
// - pub fn len(&self) -> usize
// - pub fn is_empty(&self) -> bool
// - pub fn capacity(&self) -> usize
// - pub fn clear(&mut self)
//
// Generic delegation (macro-generated):
// - pub fn foo(&self, ...) -> ...
// - pub fn foo_mut(&mut self, ...) -> ...
// - pub fn foo(self, ...) -> ...
// - pub fn foo(&self) -> &U
// - pub fn foo_mut(&mut self) -> &mut U
//
// Unsafe:
// - pub unsafe fn into_inner_unchecked(self) -> T
// - pub unsafe fn from_inner_unchecked(inner: T) -> Self
/*
/// Borrow the inner value immutably.
pub trait ApplyRef {
type Inner: ?Sized;
fn apply<R>(&self, f: impl FnOnce(&Self::Inner) -> R) -> R;
}
/// Borrow the inner value mutably.
pub trait ApplyMut: ApplyRef {
fn apply_mut<R>(&mut self, f: impl FnOnce(&mut Self::Inner) -> R) -> R;
}
/// Consume the wrapper.
pub trait ApplyInto {
type Inner;
fn apply_into<R>(self, f: impl FnOnce(Self::Inner) -> R) -> R;
}
/// Transform the inner value in-place.
pub trait Update: ApplyMut {
fn update(&mut self, f: impl FnOnce(&mut Self::Inner));
fn replace_with(&mut self, f: impl FnOnce(Self::Inner) -> Self::Inner)
where
Self::Inner: Sized;
}
/// Create an updated clone.
pub trait UpdateClone: ApplyRef
where
Self: Clone,
{
fn updated(&self, f: impl FnOnce(&mut Self::Inner)) -> Self;
fn map_clone(&self, f: impl FnOnce(Self::Inner) -> Self::Inner) -> Self
where
Self::Inner: Clone;
}pub trait Apply {
type Inner: ?Sized;
fn apply<R>(&self, f: impl FnOnce(&Self::Inner) -> R) -> R;
fn apply_mut<R>(&mut self, f: impl FnOnce(&mut Self::Inner) -> R) -> R;
fn apply_into<R>(self, f: impl FnOnce(Self::Inner) -> R) -> R
where
Self::Inner: Sized,
Self: Sized;
fn update(&mut self, f: impl FnOnce(&mut Self::Inner));
fn updated(&self, f: impl FnOnce(&mut Self::Inner)) -> Self
where
Self: Clone;
}
*/
common external crates, serde, anyhow and so on