Enum ByOption
pub enum ByOption<Via> {
_Phantom(PhantomData<Via>),
}
Expand description
Pass optional arguments by returning Option<&T::Via>
, allowing delegation to underlying type’s strategy.
This enables Option<T>
to benefit from the underlying type’s efficient passing without cloning. ByRef
doesn’t support this because it
would transform Option<T>
to &Option<T>
; however, we need Option<&T>
instead.
See ToGodot::Pass
.
Variants§
_Phantom(PhantomData<Via>)
Trait Implementations§
Auto Trait Implementations§
impl<Via> Freeze for ByOption<Via>
impl<Via> RefUnwindSafe for ByOption<Via>where
Via: RefUnwindSafe,
impl<Via> Send for ByOption<Via>where
Via: Send,
impl<Via> Sync for ByOption<Via>where
Via: Sync,
impl<Via> Unpin for ByOption<Via>where
Via: Unpin,
impl<Via> UnwindSafe for ByOption<Via>where
Via: UnwindSafe,
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