pub struct Pin<I, F, P>{ /* private fields */ }Expand description
Represents a pin, with a given ID (e.g. Gpio3), a given function (e.g. FunctionUart) and a given pull type (e.g. pull-down).
Implementations§
Source§impl<I, F, P> Pin<I, F, P>
impl<I, F, P> Pin<I, F, P>
Sourcepub unsafe fn into_unchecked<F2, P2>(self) -> Pin<I, F2, P2>
pub unsafe fn into_unchecked<F2, P2>(self) -> Pin<I, F2, P2>
§Safety
This method does not check if the pin is actually configured as the target function or pull mode. This may lead to inconsistencies between the type-state and the actual state of the pin’s configuration.
Sourcepub fn reconfigure<F2, P2>(self) -> Pin<I, F2, P2>
pub fn reconfigure<F2, P2>(self) -> Pin<I, F2, P2>
Convert the pin from one state to the other.
Sourcepub fn into_mode<F2>(self) -> Pin<I, F2, P>where
F2: Function,
I: ValidFunction<F2>,
👎Deprecated since 0.9.0: Misleading name mode when it changes the function. Please use into_function instead.
pub fn into_mode<F2>(self) -> Pin<I, F2, P>where
F2: Function,
I: ValidFunction<F2>,
mode when it changes the function. Please use into_function instead.Convert the pin function.
Sourcepub fn into_function<F2>(self) -> Pin<I, F2, P>where
F2: Function,
I: ValidFunction<F2>,
pub fn into_function<F2>(self) -> Pin<I, F2, P>where
F2: Function,
I: ValidFunction<F2>,
Convert the pin function.
Sourcepub fn into_pull_type<M2>(self) -> Pin<I, F, M2>where
M2: PullType,
pub fn into_pull_type<M2>(self) -> Pin<I, F, M2>where
M2: PullType,
Convert the pin pull type.
Sourcepub fn into_dyn_pin(self) -> Pin<DynPinId, F, P>
pub fn into_dyn_pin(self) -> Pin<DynPinId, F, P>
Erase the Pin ID type check.
Sourcepub fn pull_type(&self) -> DynPullType
pub fn pull_type(&self) -> DynPullType
Get the pin’s pull type.
Sourcepub fn into_floating_disabled(self) -> Pin<I, FunctionNull, PullNone>where
I: ValidFunction<FunctionNull>,
pub fn into_floating_disabled(self) -> Pin<I, FunctionNull, PullNone>where
I: ValidFunction<FunctionNull>,
Disable the pin and set it to float
Sourcepub fn into_pull_down_disabled(self) -> Pin<I, FunctionNull, PullDown>where
I: ValidFunction<FunctionNull>,
pub fn into_pull_down_disabled(self) -> Pin<I, FunctionNull, PullDown>where
I: ValidFunction<FunctionNull>,
Disable the pin and set it to pull down
Sourcepub fn into_pull_up_disabled(self) -> Pin<I, FunctionNull, PullUp>where
I: ValidFunction<FunctionNull>,
pub fn into_pull_up_disabled(self) -> Pin<I, FunctionNull, PullUp>where
I: ValidFunction<FunctionNull>,
Disable the pin and set it to pull up
Sourcepub fn into_floating_input(self) -> Pin<I, FunctionSio<SioInput>, PullNone>
pub fn into_floating_input(self) -> Pin<I, FunctionSio<SioInput>, PullNone>
Configure the pin to operate as a floating input
Sourcepub fn into_pull_down_input(self) -> Pin<I, FunctionSio<SioInput>, PullDown>
pub fn into_pull_down_input(self) -> Pin<I, FunctionSio<SioInput>, PullDown>
Configure the pin to operate as a pulled down input
Sourcepub fn into_pull_up_input(self) -> Pin<I, FunctionSio<SioInput>, PullUp>
pub fn into_pull_up_input(self) -> Pin<I, FunctionSio<SioInput>, PullUp>
Configure the pin to operate as a pulled up input
Sourcepub fn into_bus_keep_input(self) -> Pin<I, FunctionSio<SioInput>, PullBusKeep>
pub fn into_bus_keep_input(self) -> Pin<I, FunctionSio<SioInput>, PullBusKeep>
Configure the pin to operate as a bus keep input
Sourcepub fn into_push_pull_output(self) -> Pin<I, FunctionSio<SioOutput>, P>
pub fn into_push_pull_output(self) -> Pin<I, FunctionSio<SioOutput>, P>
Configure the pin to operate as a push-pull output.
If you want to specify the initial pin state, use Pin::into_push_pull_output_in_state.
Sourcepub fn into_push_pull_output_in_state(
self,
state: PinState,
) -> Pin<I, FunctionSio<SioOutput>, P>
pub fn into_push_pull_output_in_state( self, state: PinState, ) -> Pin<I, FunctionSio<SioOutput>, P>
Configure the pin to operate as a push-pull output, specifying an initial state which is applied immediately.
Sourcepub fn into_readable_output(self) -> Pin<I, FunctionSio<SioOutput>, P>
👎Deprecated since 0.9.0: All gpio are readable, use .into_push_pull_output() instead.
pub fn into_readable_output(self) -> Pin<I, FunctionSio<SioOutput>, P>
.into_push_pull_output() instead.Configure the pin to operate as a readable push pull output.
If you want to specify the initial pin state, use Pin::into_readable_output_in_state.
Sourcepub fn into_readable_output_in_state(
self,
state: PinState,
) -> Pin<I, FunctionSio<SioOutput>, P>
👎Deprecated since 0.9.0: All gpio are readable, use .into_push_pull_output_in_state() instead.
pub fn into_readable_output_in_state( self, state: PinState, ) -> Pin<I, FunctionSio<SioOutput>, P>
.into_push_pull_output_in_state() instead.Configure the pin to operate as a readable push pull output, specifying an initial state which is applied immediately.
Sourcepub fn get_drive_strength(&self) -> OutputDriveStrength
pub fn get_drive_strength(&self) -> OutputDriveStrength
Get the current drive strength of the pin.
Sourcepub fn set_drive_strength(&mut self, strength: OutputDriveStrength)
pub fn set_drive_strength(&mut self, strength: OutputDriveStrength)
Set the drive strength for the pin.
Sourcepub fn get_slew_rate(&self) -> OutputSlewRate
pub fn get_slew_rate(&self) -> OutputSlewRate
Get the slew rate for the pin.
Sourcepub fn set_slew_rate(&mut self, rate: OutputSlewRate)
pub fn set_slew_rate(&mut self, rate: OutputSlewRate)
Set the slew rate for the pin.
Sourcepub fn get_schmitt_enabled(&self) -> bool
pub fn get_schmitt_enabled(&self) -> bool
Get whether the schmitt trigger (hysteresis) is enabled.
Sourcepub fn set_schmitt_enabled(&self, enable: bool)
pub fn set_schmitt_enabled(&self, enable: bool)
Enable/Disable the schmitt trigger.
Sourcepub fn get_output_disable(&mut self) -> bool
pub fn get_output_disable(&mut self) -> bool
Get the state of the digital output circuitry of the pad.
Sourcepub fn set_output_disable(&mut self, disable: bool)
pub fn set_output_disable(&mut self, disable: bool)
Set the digital output circuitry of the pad.
Sourcepub fn get_input_enable(&mut self) -> bool
pub fn get_input_enable(&mut self) -> bool
Get the state of the digital input circuitry of the pad.
Sourcepub fn set_input_enable(&mut self, enable: bool)
pub fn set_input_enable(&mut self, enable: bool)
Set the digital input circuitry of the pad.
Sourcepub fn get_input_override(&self) -> InputOverride
pub fn get_input_override(&self) -> InputOverride
Get the input override.
Sourcepub fn set_input_override(&mut self, override_value: InputOverride)
pub fn set_input_override(&mut self, override_value: InputOverride)
Set the input override.
Sourcepub fn get_output_enable_override(&self) -> OutputEnableOverride
pub fn get_output_enable_override(&self) -> OutputEnableOverride
Get the output enable override.
Sourcepub fn set_output_enable_override(
&mut self,
override_value: OutputEnableOverride,
)
pub fn set_output_enable_override( &mut self, override_value: OutputEnableOverride, )
Set the output enable override.
Sourcepub fn get_output_override(&self) -> OutputOverride
pub fn get_output_override(&self) -> OutputOverride
Get the output override.
Sourcepub fn set_output_override(&mut self, override_value: OutputOverride)
pub fn set_output_override(&mut self, override_value: OutputOverride)
Set the output override.
Sourcepub fn get_interrupt_override(&self) -> InterruptOverride
pub fn get_interrupt_override(&self) -> InterruptOverride
Get the interrupt override.
Sourcepub fn set_interrupt_override(&mut self, override_value: InterruptOverride)
pub fn set_interrupt_override(&mut self, override_value: InterruptOverride)
Set the interrupt override.
Sourcepub fn clear_interrupt(&mut self, interrupt: Interrupt)
pub fn clear_interrupt(&mut self, interrupt: Interrupt)
Clear interrupt.
Sourcepub fn interrupt_status(&self, interrupt: Interrupt) -> bool
pub fn interrupt_status(&self, interrupt: Interrupt) -> bool
Interrupt status.
Sourcepub fn is_interrupt_enabled(&self, interrupt: Interrupt) -> bool
pub fn is_interrupt_enabled(&self, interrupt: Interrupt) -> bool
Is interrupt enabled.
Sourcepub fn set_interrupt_enabled(&self, interrupt: Interrupt, enabled: bool)
pub fn set_interrupt_enabled(&self, interrupt: Interrupt, enabled: bool)
Enable or disable interrupt.
Sourcepub fn is_interrupt_forced(&self, interrupt: Interrupt) -> bool
pub fn is_interrupt_forced(&self, interrupt: Interrupt) -> bool
Is interrupt forced.
Sourcepub fn set_interrupt_forced(&self, interrupt: Interrupt, forced: bool)
pub fn set_interrupt_forced(&self, interrupt: Interrupt, forced: bool)
Force or release interrupt.
Sourcepub fn dormant_wake_status(&self, interrupt: Interrupt) -> bool
pub fn dormant_wake_status(&self, interrupt: Interrupt) -> bool
Dormant wake status.
Sourcepub fn is_dormant_wake_enabled(&self, interrupt: Interrupt) -> bool
pub fn is_dormant_wake_enabled(&self, interrupt: Interrupt) -> bool
Is dormant wake enabled.
Sourcepub fn set_dormant_wake_enabled(&self, interrupt: Interrupt, enabled: bool)
pub fn set_dormant_wake_enabled(&self, interrupt: Interrupt, enabled: bool)
Enable or disable dormant wake.
Sourcepub fn is_dormant_wake_forced(&self, interrupt: Interrupt) -> bool
pub fn is_dormant_wake_forced(&self, interrupt: Interrupt) -> bool
Is dormant wake forced.
Sourcepub fn set_dormant_wake_forced(&mut self, interrupt: Interrupt, forced: bool)
pub fn set_dormant_wake_forced(&mut self, interrupt: Interrupt, forced: bool)
Force dormant wake.
Sourcepub fn as_input(&self) -> AsInputPin<'_, I, F, P>
pub fn as_input(&self) -> AsInputPin<'_, I, F, P>
Return a wrapper that implements InputPin.
This allows to read from the pin independent of the selected function. Depending on the pad configuration, reading from the pin may not return a meaningful result.
Calling this function does not set the pad’s input enable bit.
Source§impl<I, C, P> Pin<I, FunctionSio<C>, P>
impl<I, C, P> Pin<I, FunctionSio<C>, P>
Sourcepub fn is_sync_bypass(&self) -> bool
pub fn is_sync_bypass(&self) -> bool
Is bypass enabled
Sourcepub fn set_sync_bypass(&mut self, bypass: bool)
pub fn set_sync_bypass(&mut self, bypass: bool)
Bypass the input sync stages.
This saves two clock cycles in the input signal’s path at the risks of introducing metastability.
Source§impl<F, P> Pin<DynPinId, F, P>
impl<F, P> Pin<DynPinId, F, P>
Source§impl<I, P> Pin<I, DynFunction, P>
impl<I, P> Pin<I, DynFunction, P>
Sourcepub fn try_set_function(
&mut self,
function: DynFunction,
) -> Result<(), InvalidFunction>
pub fn try_set_function( &mut self, function: DynFunction, ) -> Result<(), InvalidFunction>
Try to set the pin’s function.
This method may fail if the requested function is not supported by the pin, eg FunctionXiP
on a gpio from Bank0.
Sourcepub fn function(&self) -> DynFunction
pub fn function(&self) -> DynFunction
Gets the pin’s function.
Source§impl<I, F> Pin<I, F, DynPullType>
impl<I, F> Pin<I, F, DynPullType>
Sourcepub fn set_pull_type(&mut self, pull_type: DynPullType)
pub fn set_pull_type(&mut self, pull_type: DynPullType)
Set the pin’s pull type.
Trait Implementations§
Source§impl<M> ClockSource for Pin<Gpio20, FunctionClock, M>where
M: PullType,
impl<M> ClockSource for Pin<Gpio20, FunctionClock, M>where
M: PullType,
Source§impl<M> ClockSource for Pin<Gpio22, FunctionClock, M>where
M: PullType,
impl<M> ClockSource for Pin<Gpio22, FunctionClock, M>where
M: PullType,
Source§impl<I, P, S> ErrorType for Pin<I, FunctionSio<S>, P>
impl<I, P, S> ErrorType for Pin<I, FunctionSio<S>, P>
Source§type Error = Infallible
type Error = Infallible
Source§impl<I, P> InputPin for Pin<I, FunctionSio<SioOutput>, P>
Deprecated: Instead of implicitly implementing InputPin for function SioOutput,
use pin.as_input() to get access to input values independent of the selected function.
impl<I, P> InputPin for Pin<I, FunctionSio<SioOutput>, P>
Deprecated: Instead of implicitly implementing InputPin for function SioOutput,
use pin.as_input() to get access to input values independent of the selected function.
Source§impl<I, P> OutputPin for Pin<I, FunctionSio<SioOutput>, P>
impl<I, P> OutputPin for Pin<I, FunctionSio<SioOutput>, P>
Source§type Error = Infallible
type Error = Infallible
Source§fn set_low(
&mut self,
) -> Result<(), <Pin<I, FunctionSio<SioOutput>, P> as OutputPin>::Error>
fn set_low( &mut self, ) -> Result<(), <Pin<I, FunctionSio<SioOutput>, P> as OutputPin>::Error>
Source§impl<I, P> OutputPin for Pin<I, FunctionSio<SioOutput>, P>
impl<I, P> OutputPin for Pin<I, FunctionSio<SioOutput>, P>
Source§impl<I, P> StatefulOutputPin for Pin<I, FunctionSio<SioOutput>, P>
impl<I, P> StatefulOutputPin for Pin<I, FunctionSio<SioOutput>, P>
Source§impl<I, P> StatefulOutputPin for Pin<I, FunctionSio<SioOutput>, P>
impl<I, P> StatefulOutputPin for Pin<I, FunctionSio<SioOutput>, P>
Source§impl<I, P> ToggleableOutputPin for Pin<I, FunctionSio<SioOutput>, P>
impl<I, P> ToggleableOutputPin for Pin<I, FunctionSio<SioOutput>, P>
Source§type Error = Infallible
type Error = Infallible
Source§fn toggle(
&mut self,
) -> Result<(), <Pin<I, FunctionSio<SioOutput>, P> as ToggleableOutputPin>::Error>
fn toggle( &mut self, ) -> Result<(), <Pin<I, FunctionSio<SioOutput>, P> as ToggleableOutputPin>::Error>
Source§impl ValidSrc<GpioOutput0Clock> for Pin<Gpio20, FunctionClock, PullNone>
impl ValidSrc<GpioOutput0Clock> for Pin<Gpio20, FunctionClock, PullNone>
Source§impl ValidSrc<GpioOutput0Clock> for Pin<Gpio22, FunctionClock, PullNone>
impl ValidSrc<GpioOutput0Clock> for Pin<Gpio22, FunctionClock, PullNone>
Source§impl ValidSrc<GpioOutput1Clock> for Pin<Gpio20, FunctionClock, PullNone>
impl ValidSrc<GpioOutput1Clock> for Pin<Gpio20, FunctionClock, PullNone>
Source§impl ValidSrc<GpioOutput1Clock> for Pin<Gpio22, FunctionClock, PullNone>
impl ValidSrc<GpioOutput1Clock> for Pin<Gpio22, FunctionClock, PullNone>
Source§impl ValidSrc<GpioOutput2Clock> for Pin<Gpio20, FunctionClock, PullNone>
impl ValidSrc<GpioOutput2Clock> for Pin<Gpio20, FunctionClock, PullNone>
Source§impl ValidSrc<GpioOutput2Clock> for Pin<Gpio22, FunctionClock, PullNone>
impl ValidSrc<GpioOutput2Clock> for Pin<Gpio22, FunctionClock, PullNone>
Source§impl ValidSrc<GpioOutput3Clock> for Pin<Gpio20, FunctionClock, PullNone>
impl ValidSrc<GpioOutput3Clock> for Pin<Gpio20, FunctionClock, PullNone>
Source§impl ValidSrc<GpioOutput3Clock> for Pin<Gpio22, FunctionClock, PullNone>
impl ValidSrc<GpioOutput3Clock> for Pin<Gpio22, FunctionClock, PullNone>
Source§impl ValidSrc<PeripheralClock> for Pin<Gpio20, FunctionClock, PullNone>
impl ValidSrc<PeripheralClock> for Pin<Gpio20, FunctionClock, PullNone>
Source§impl ValidSrc<PeripheralClock> for Pin<Gpio22, FunctionClock, PullNone>
impl ValidSrc<PeripheralClock> for Pin<Gpio22, FunctionClock, PullNone>
Source§impl ValidSrc<ReferenceClock> for Pin<Gpio20, FunctionClock, PullNone>
impl ValidSrc<ReferenceClock> for Pin<Gpio20, FunctionClock, PullNone>
Source§impl ValidSrc<ReferenceClock> for Pin<Gpio22, FunctionClock, PullNone>
impl ValidSrc<ReferenceClock> for Pin<Gpio22, FunctionClock, PullNone>
Source§impl ValidSrc<SystemClock> for Pin<Gpio20, FunctionClock, PullNone>
impl ValidSrc<SystemClock> for Pin<Gpio20, FunctionClock, PullNone>
Source§impl ValidSrc<SystemClock> for Pin<Gpio22, FunctionClock, PullNone>
impl ValidSrc<SystemClock> for Pin<Gpio22, FunctionClock, PullNone>
impl<P> ValidPinCts<UART0> for Pin<Gpio14, FunctionUart, P>where
P: PullType,
impl<P> ValidPinCts<UART0> for Pin<Gpio18, FunctionUart, P>where
P: PullType,
impl<P> ValidPinCts<UART0> for Pin<Gpio2, FunctionUart, P>where
P: PullType,
impl<P> ValidPinCts<UART1> for Pin<Gpio10, FunctionUart, P>where
P: PullType,
impl<P> ValidPinCts<UART1> for Pin<Gpio22, FunctionUart, P>where
P: PullType,
impl<P> ValidPinCts<UART1> for Pin<Gpio26, FunctionUart, P>where
P: PullType,
impl<P> ValidPinCts<UART1> for Pin<Gpio6, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRts<UART0> for Pin<Gpio15, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRts<UART0> for Pin<Gpio19, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRts<UART0> for Pin<Gpio3, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRts<UART1> for Pin<Gpio11, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRts<UART1> for Pin<Gpio23, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRts<UART1> for Pin<Gpio27, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRts<UART1> for Pin<Gpio7, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART0> for Pin<Gpio1, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART0> for Pin<Gpio13, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART0> for Pin<Gpio15, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinRx<UART0> for Pin<Gpio17, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART0> for Pin<Gpio19, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinRx<UART0> for Pin<Gpio29, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART0> for Pin<Gpio3, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio11, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio21, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio23, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio25, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio27, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio5, FunctionUart, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio7, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinRx<UART1> for Pin<Gpio9, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART0> for Pin<Gpio0, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART0> for Pin<Gpio12, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART0> for Pin<Gpio14, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinTx<UART0> for Pin<Gpio16, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART0> for Pin<Gpio18, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinTx<UART0> for Pin<Gpio2, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinTx<UART0> for Pin<Gpio28, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio10, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio20, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio22, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio24, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio26, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio4, FunctionUart, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio6, FunctionUartAux, P>where
P: PullType,
impl<P> ValidPinTx<UART1> for Pin<Gpio8, FunctionUart, P>where
P: PullType,
Auto Trait Implementations§
impl<I, F, P> Freeze for Pin<I, F, P>
impl<I, F, P> RefUnwindSafe for Pin<I, F, P>
impl<I, F, P> Send for Pin<I, F, P>
impl<I, F, P> Sync for Pin<I, F, P>
impl<I, F, P> Unpin for Pin<I, F, P>
impl<I, F, P> UnwindSafe for Pin<I, F, P>
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
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more