### EXTI Input Driver API Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput This section details the ExtiInput struct and its associated methods for configuring and interacting with EXTI inputs. ```APIDOC ## Struct ExtiInput ### Description EXTI input driver. This driver augments a GPIO `Input` with EXTI functionality. EXTI is not built into `Input` itself because it needs to take ownership of the corresponding EXTI channel, which is a limited resource. Pins PA5, PB5, PC5… all use EXTI channel 5, so you can’t use EXTI on, say, PA5 and PC5 at the same time. ## Implementations ### impl<'d> ExtiInput<'d> #### pub fn new( pin: Peri<'d, T>, _ch: Peri<'d, T::ExtiChannel>, pull: Pull, _irq: impl Binding<<::ExtiChannel as Channel>::IRQ>, InterruptHandler<<::ExtiChannel as Channel>::IRQ>>, ) -> Self **Description**: Create an EXTI input. The Binding must bind the Channel’s IRQ to InterruptHandler. **Method**: POST (Conceptual - creation of a resource) **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/new` #### pub fn is_high(&self) -> bool **Description**: Get whether the pin is high. **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/is_high` #### pub fn is_low(&self) -> bool **Description**: Get whether the pin is low. **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/is_low` #### pub fn get_level(&self) -> Level **Description**: Get the pin level. **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/level` #### pub async fn wait_for_high(&mut self) **Description**: Asynchronously wait until the pin is high. This returns immediately if the pin is already high. **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/wait/high` #### pub async fn wait_for_low(&mut self) **Description**: Asynchronously wait until the pin is low. This returns immediately if the pin is already low. **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/wait/low` #### pub async fn wait_for_rising_edge(&mut self) **Description**: Asynchronously wait until the pin sees a rising edge. If the pin is already high, it will wait for it to go low then back high. **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/wait/rising_edge` #### pub fn poll_for_rising_edge<'a>(&mut self, cx: &mut Context<'a>) **Description**: Asynchronously wait until the pin sees a rising edge. If the pin is already high, it will wait for it to go low then back high. This is a polling version. **Method**: POST **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/poll/rising_edge` #### pub async fn wait_for_falling_edge(&mut self) **Description**: Asynchronously wait until the pin sees a falling edge. If the pin is already low, it will wait for it to go high then back low. **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/wait/falling_edge` #### pub fn poll_for_falling_edge<'a>(&mut self, cx: &mut Context<'a>) **Description**: Asynchronously wait until the pin sees a falling edge. If the pin is already low, it will wait for it to go high then back low. This is a polling version. **Method**: POST **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/poll/falling_edge` #### pub async fn wait_for_any_edge(&mut self) **Description**: Asynchronously wait until the pin sees any edge (either rising or falling). **Method**: GET **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/wait/any_edge` #### pub fn poll_for_any_edge<'a>(&mut self, cx: &mut Context<'a>) **Description**: Asynchronously wait until the pin sees any edge (either rising or falling). This is a polling version. **Method**: POST **Endpoint**: `/websites/embassy_dev_embassy-stm32_git_stm32c092kb_exti/poll/any_edge` ### Trait Implementations #### impl<'d> ErrorType for ExtiInput<'d> **Description**: Defines the error type for EXTI operations. **Type**: `Error = Infallible` #### impl<'d> InputPin for ExtiInput<'d> **Description**: Implements the `InputPin` trait for checking pin state. **Type**: `Error = Infallible` **Methods**: `is_high()`, `is_low()` #### impl<'d> Wait for ExtiInput<'d> **Description**: Implements asynchronous waiting for pin edge transitions. **Methods**: `wait_for_high()`, `wait_for_low()`, `wait_for_rising_edge()`, `wait_for_falling_edge()`, `wait_for_any_edge()` ``` -------------------------------- ### TryInto Trait Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput The `TryInto` trait provides a convenient way to perform fallible conversions from one type into another. It is automatically implemented when `TryFrom` is implemented. ```APIDOC ## impl TryInto for T ### Description This trait allows attempting a conversion from the current type `T` to another type `U`. It's the idiomatic way to perform fallible conversions when the target type implements `TryFrom`. ### Method `try_into` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (Result) - **Ok(U)**: The converted value of type `U`. - **Err(E)**: An error object of type `E` (where `E` is `>::Error`), indicating the conversion failed. #### Response Example ```rust let result: Result = source_value.try_into(); ``` ### Error Handling - **Error Type**: `type Error = >::Error` The specific error type returned when the conversion fails is determined by the `TryFrom` implementation for the target type `U`. ``` -------------------------------- ### Create Embassy STM32 EXTI Input Driver (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput Initializes an EXTI input driver. This function requires a GPIO pin, its corresponding EXTI channel, pull-up/down configuration, and an interrupt handler binding for the EXTI channel's IRQ. The binding is crucial for enabling interrupt notifications. ```rust pub fn new( pin: Peri<'d, T>, _ch: Peri<'d, T::ExtiChannel>, pull: Pull, _irq: impl Binding<<::ExtiChannel as Channel>::IRQ, InterruptHandler<<::ExtiChannel as Channel>::IRQ>>, ) -> Self ``` -------------------------------- ### TryFrom Trait Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput The `TryFrom` trait provides a way to perform fallible conversions from one type into another. It is the inverse of `TryInto`. ```APIDOC ## impl TryFrom for T ### Description This trait allows attempting a conversion from type `U` to type `T`. The conversion can fail, in which case an error is returned. ### Method `try_from` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (Result) - **Ok(T)**: The converted value of type `T`. - **Err(E)**: An error object of type `E` (where `E` is `>::Error`), indicating the conversion failed. #### Response Example ```rust let result: Result = MyType::try_from(some_value); ``` ### Error Handling - **Error Type**: `type Error = >::Error` The specific error type returned when the conversion fails is defined by the associated `Error` type within the `TryFrom` implementation. ``` -------------------------------- ### Asynchronously Wait for Pin Events with Embassy STM32 EXTI (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput Enables asynchronous waiting for various pin events. `wait_for_high` and `wait_for_low` pause execution until the respective pin level is detected. `wait_for_rising_edge`, `wait_for_falling_edge`, and `wait_for_any_edge` provide functionality to wait for specific transitions. ```rust pub async fn wait_for_high(&mut self) pub async fn wait_for_low(&mut self) pub async fn wait_for_rising_edge(&mut self) pub async fn wait_for_falling_edge(&mut self) pub async fn wait_for_any_edge(&mut self) // Through Wait trait async fn wait_for_high(&mut self) -> Result<(), Self::Error> async fn wait_for_low(&mut self) -> Result<(), Self::Error> async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> ``` -------------------------------- ### Embassy STM32 EXTI Input Driver Structure Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput Defines the ExtiInput structure, which enhances a GPIO Input with EXTI capabilities. This driver requires exclusive ownership of an EXTI channel, as multiple pins can share the same EXTI channel. ```rust pub struct ExtiInput<'d> { /* private fields */ } ``` -------------------------------- ### Rust TryInto Trait Implementation Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput The TryInto trait provides a convenient way to perform fallible conversions from a type (T) into another type (U), leveraging the TryFrom trait. It defines an Error type and a try_into method. ```rust impl TryInto for T where U: TryFrom, { type Error = >::Error; fn try_into(self) -> Result { U::try_from(self) } } ``` -------------------------------- ### EXTI Conversion Implementations for AnyChannel (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.AnyChannel These implementations show how various EXTI types (EXTI0 through EXTI15) could be converted into the deprecated AnyChannel struct. Support for these conversions has been removed. ```rust impl From for AnyChannel { fn from(_val: EXTI0) -> Self } impl From for AnyChannel { fn from(_val: EXTI1) -> Self } // ... and so on for EXTI2 through EXTI15 ``` -------------------------------- ### EXTI Channel Configuration Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/trait.Channel This section describes the EXTI channel configuration, including the interrupt type and channel number. ```APIDOC ## EXTI Channel Details ### Description Provides information about EXTI channels, including their associated interrupt type and channel number. ### Parameters #### Path Parameters - **channel** (string) - Required - The specific EXTI channel (e.g., EXTI0, EXTI1, EXTI15). #### Query Parameters None #### Request Body None ### Request Example ```json { "channel": "EXTI0" } ``` ### Response #### Success Response (200) - **IRQ** (InterruptType) - The type of interrupt associated with the EXTI channel. - **number** (PinNumber) - The EXTI channel number. #### Response Example ```json { "IRQ": "EXTI0_1", "number": 0 } ``` ### Error Handling - **404**: Channel not found. - **500**: Internal server error. ``` -------------------------------- ### Check Pin State with Embassy STM32 EXTI Input (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput Provides methods to check the current state of the EXTI input pin. `is_high` returns true if the pin is high, and `is_low` returns true if the pin is low. These methods are also available through the `InputPin` trait implementation. ```rust pub fn is_high(&self) -> bool pub fn is_low(&self) -> bool // Through InputPin trait fn is_high(&self) -> Result fn is_low(&self) -> Result ``` -------------------------------- ### Blanket Implementations Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Details blanket implementations for common traits applied to the generic type `T` within `InterruptHandler`, showing how `InterruptHandler` integrates with standard Rust patterns. ```APIDOC ## Blanket Implementations ### `impl Any for T` where T: 'static + ?Sized #### `fn type_id(&self) -> TypeId` Gets the `TypeId` of `self`. This allows for runtime type identification. ### `impl Borrow for T` where T: ?Sized #### `fn borrow(&self) -> &T` Immutably borrows from an owned value. ### `impl BorrowMut for T` where T: ?Sized #### `fn borrow_mut(&mut self) -> &mut T` Mutably borrows from an owned value. ### `impl From for T` #### `fn from(t: T) -> T` Returns the argument unchanged. This is a trivial implementation for the `From` trait. ### `impl Into for T` where U: From #### `fn into(self) -> U` Calls `U::from(self)`. This allows for conversion between types where a `From` implementation exists. ### `impl TryFrom for T` where U: Into #### `type Error = Infallible` The type returned in the event of a conversion error. `Infallible` indicates that this conversion is always successful. #### `fn try_from(value: U) -> Result>::Error>` Performs the conversion. Since the `Error` type is `Infallible`, this function effectively always returns `Ok(T)`. ### `impl TryInto for T` where U: TryFrom #### `type Error = >::Error` The type returned in the event of a conversion error. #### `fn try_into(self) -> Result>::Error>` Performs the conversion using the `TryFrom` implementation for the target type `U`. ``` -------------------------------- ### Polling for Pin Edges with Embassy STM32 EXTI (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput Provides polling functions for detecting edge transitions without blocking indefinitely. `poll_for_rising_edge`, `poll_for_falling_edge`, and `poll_for_any_edge` can be used within an async runtime's polling mechanism to check for edge events. ```rust pub fn poll_for_rising_edge<'a>(&mut self, cx: &mut Context<'a>) pub fn poll_for_falling_edge<'a>(&mut self, cx: &mut Context<'a>) pub fn poll_for_any_edge<'a>(&mut self, cx: &mut Context<'a>) ``` -------------------------------- ### EXTI Channel Trait Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/trait.Channel The `Channel` trait defines the interface for EXTI channels, including their associated IRQ types and methods for retrieving channel number and IRQ. ```APIDOC ## Trait: Channel ### Description EXTI channel trait. This trait is implemented by types representing EXTI channels, providing access to their interrupt configurations and numbers. ### Associated Types - **IRQ** (`InterruptType`): The type of the interrupt associated with this channel. ### Methods - **`number(&self) -> PinNumber`**: Returns the numerical identifier of the EXTI channel. - **`irq(&self) -> InterruptEnum`**: Returns the interrupt enum corresponding to the EXTI channel. ``` -------------------------------- ### Deprecated AnyChannel EXTI Channel Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.AnyChannel The AnyChannel struct was used for type-erased EXTI channels but is now deprecated. Support was removed to enable manually bindable EXTI interrupts, requiring IRQs to be known at compile time. ```APIDOC ## Deprecated: AnyChannel EXTI Channel ### Description Type-erased EXTI channels are no longer supported. This was done to support manually bindable EXTI interrupts, which require the IRQ to be known at compile time. Therefore, `ExtiInput::new()` cannot support type-erased channels. ### Status Deprecated ### Reason for Deprecation Removal of support for manually bindable EXTI interrupts via `bind_interrupts`. ### Related Information - [GitHub PR #4922](https://github.com/embassy-rs/embassy/pull/4922) ### Trait Implementations #### `impl From for AnyChannel` - Converts from `EXTI0` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI1` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI10` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI11` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI12` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI13` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI14` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI15` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI2` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI3` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI4` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI5` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI6` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI7` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI8` to `AnyChannel`. #### `impl From for AnyChannel` - Converts from `EXTI9` to `AnyChannel`. ### Auto Trait Implementations - `Freeze` - `RefUnwindSafe` - `Send` - `Sync` - `Unpin` - `UnwindSafe` ### Blanket Implementations #### `impl Any for T` - `type_id(&self) -> TypeId`: Gets the `TypeId` of `self`. #### `impl Borrow for T` - `borrow(&self) -> &T`: Immutably borrows from an owned value. #### `impl BorrowMut for T` - `borrow_mut(&mut self) -> &mut T`: Mutably borrows from an owned value. #### `impl From for T` - `from(t: T) -> T`: Returns the argument unchanged. #### `impl Into for T` - `into(self) -> U`: Calls `U::from(self)`. #### `impl TryFrom for T` - `type Error = Infallible`: The type returned in the event of a conversion error. - `try_from(value: U) -> Result>::Error>`: Performs the conversion. #### `impl TryInto for T` - `type Error = >::Error`: The type returned in the event of a conversion error. - `try_into(self) -> Result>::Error>`: Performs the conversion. ``` -------------------------------- ### Rust TryFrom Trait Implementation Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.ExtiInput The TryFrom trait enables fallible conversions from one type (U) to another (T). It defines an associated Error type for conversion failures and a try_from function that returns a Result. ```rust impl TryFrom for T where U: TryFrom, { type Error = >::Error; fn try_from(value: U) -> Result { // Implementation details... unimplemented!() } } ``` -------------------------------- ### Implement Any Trait for Generic Type T (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Provides an implementation of the Any trait for any type T that is 'static and Sized. This allows for runtime type identification using the type_id method. ```rust impl Any for T where T: 'static + ?Sized, { fn type_id(&self) -> TypeId { // Implementation to get the TypeId } } ``` -------------------------------- ### AnyChannel Struct Definition (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.AnyChannel Defines the AnyChannel struct, which is now deprecated. This struct was used for type-erased EXTI channels but has been removed in favor of a new system for handling EXTI interrupts. ```rust pub struct AnyChannel { /* private fields */ } ``` -------------------------------- ### EXTI Channel Trait Definition Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/trait.Channel Defines the `Channel` trait for EXTI functionality in embassy-stm32. It requires implementations to specify an associated IRQ type and provide methods for retrieving the channel number and its corresponding interrupt. ```rust pub trait Channel: PeripheralType + SealedChannel + Sized { type IRQ: InterruptType; // Required methods fn number(&self) -> PinNumber; fn irq(&self) -> InterruptEnum; } ``` -------------------------------- ### Auto Trait Implementations for InterruptHandler Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Provides information on the automatic trait implementations for the `InterruptHandler` struct, indicating its thread-safety and memory management characteristics. ```APIDOC ## Auto Trait Implementations for InterruptHandler ### `impl Freeze for InterruptHandler` Indicates that the `InterruptHandler` can be frozen (made immutable). ### `impl RefUnwindSafe for InterruptHandler` where T: RefUnwindSafe Indicates that the `InterruptHandler` is safe to unwind across when references are involved. ### `impl Send for InterruptHandler` where T: Send Indicates that the `InterruptHandler` can be safely sent between threads. ### `impl Sync for InterruptHandler` where T: Sync Indicates that the `InterruptHandler` can be safely shared between threads. ### `impl Unpin for InterruptHandler` where T: Unpin Indicates that the `InterruptHandler` does not require special handling for pinning in memory. ### `impl UnwindSafe for InterruptHandler` where T: UnwindSafe Indicates that the `InterruptHandler` is safe to unwind across. ``` -------------------------------- ### Handler Trait Implementation Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Implementation of the `Handler` trait for the `InterruptHandler` struct, providing the core interrupt handling function. ```APIDOC ## impl Handler for InterruptHandler ### Description This block details the implementation of the `Handler` trait for the `InterruptHandler` struct, enabling it to process interrupts. ### Methods #### `unsafe fn on_interrupt()` ##### Description This is the main interrupt handler function. It is marked as `unsafe` because it directly interacts with hardware interrupts and requires careful management to prevent undefined behavior. ##### Usage This function is typically called by the system's interrupt vector table when a specific EXTI interrupt occurs. ##### Safety This function is `unsafe` and should only be called within the context of an interrupt service routine. Proper synchronization and state management are crucial when this function is invoked. ``` -------------------------------- ### InterruptHandler Struct Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler The InterruptHandler struct is a generic handler for EXTI interrupts. It ensures that multiple EXTI interrupts multiplexed into a single vector are handled correctly. ```APIDOC ## Struct InterruptHandler ### Description EXTI interrupt handler. All EXTI interrupt vectors should be bound to this handler. It is generic over the `Interrupt` trait rather than the `Channel` because it should not be bound multiple times to the same vector on chips which multiplex multiple EXTI interrupts into one vector. ### Fields (Private fields, not exposed) ### Example ```rust // Assuming an Interrupt type 'MyInterrupt' is defined // let mut handler = InterruptHandler::::new(); ``` ``` -------------------------------- ### Implement TryFrom Trait for Generic Type U into T (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Implements the TryFrom trait for attempting to convert a type U into a type T, where U implements Into. This conversion can fail, returning a Result with an Infallible error type. ```rust impl TryFrom for T where U: Into, { type Error = Infallible; fn try_from(value: U) -> Result { Ok(value.into()) } } ``` -------------------------------- ### Implement TryInto Trait for Generic Type T into U (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Implements the TryInto trait for attempting to convert a type T into a type U, where U implements TryFrom. This conversion might fail, and the error type is determined by the TryFrom implementation. ```rust impl TryInto for T where U: TryFrom, { type Error = > :: Error; fn try_into(self) -> Result { U::try_from(self) } } ``` -------------------------------- ### Define EXTI Interrupt Handler Struct (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Defines the InterruptHandler struct, which is generic over an Interrupt type. This struct is intended to handle EXTI interrupts and is designed to be bound to all EXTI interrupt vectors, accommodating multiplexed interrupts on some chips. ```rust pub struct InterruptHandler { /* private fields */ } ``` -------------------------------- ### Implement Into Trait for Generic Type T into U (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Implements the Into trait for converting a type T into a type U, provided that U implements From. This allows for convenient conversion using the into() method. ```rust impl Into for T where U: From, { fn into(self) -> U { U::from(self) } } ``` -------------------------------- ### Implement From Trait for Generic Type T (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Provides a From implementation for a generic type T, where the target type is also T. This essentially means that a value of type T can be converted into itself, returning the argument unchanged. ```rust impl From for T { fn from(t: T) -> T { t } } ``` -------------------------------- ### Implement Handler Trait for InterruptHandler (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Implements the Handler trait for the InterruptHandler struct. This allows the InterruptHandler to respond to interrupts by calling its associated on_interrupt function. ```rust impl Handler for InterruptHandler { unsafe fn on_interrupt() { // Interrupt handler function implementation } } ``` -------------------------------- ### Implement BorrowMut Trait for Generic Type T (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Implements the BorrowMut trait for a generic type T. This allows for mutable borrowing of a value of type T, enabling modification of its contents. ```rust impl BorrowMut for T where T: ?Sized, { fn borrow_mut(&mut self) -> &mut T { // Implementation for mutable borrowing } } ``` -------------------------------- ### Implement Borrow Trait for Generic Type T (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/exti/struct.InterruptHandler Implements the Borrow trait for a generic type T. This enables immutable borrowing of a value of type T, allowing access to its contents without taking ownership. ```rust impl Borrow for T where T: ?Sized, { fn borrow(&self) -> &T { // Implementation for immutable borrowing } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.