Define type alias `Shared`

This commit is contained in:
bitfl0wer 2024-01-21 17:06:43 +01:00
parent d3853700c0
commit 315fe8e33b
No known key found for this signature in database
GPG Key ID: 0ACD574FCF5226CF
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>>;