Define type alias `Shared`

This commit is contained in:
bitfl0wer 2024-01-21 17:06:43 +01:00
parent 21a59b4d8a
commit 92654989e8
1 changed files with 8 additions and 0 deletions

View File

@ -122,3 +122,11 @@ impl<T: WebSocketEvent> GatewayEvent<T> {
} }
} }
} }
/// A type alias for [`Arc<RwLock<T>>`], used to make the public facing API concerned with
/// Composite structs more ergonomic.
/// ## Note
///
/// While `T` does not have to implement `Composite` to be used with `Shared`,
/// the primary use of `Shared` is with types that implement `Composite`.
pub type Shared<T> = Arc<RwLock<T>>;