Add documentation for into_shared

This commit is contained in:
bitfl0wer 2024-01-21 17:15:11 +01:00
parent 400d4c74cf
commit bae0ce8b1f
1 changed files with 6 additions and 0 deletions

View File

@ -124,6 +124,12 @@ pub trait Composite<T: Updateable + Clone + Debug> {
vec
}
/// Uses [`Shared`] to provide an ergonomic alternative to `Arc::new(RwLock::new(obj))`.
///
/// [`Shared<Self>`] can then be observed using the [`Gateway`], turning the underlying
/// `dyn Composite<Self>` into a self-updating struct, which is a tracked variant of a chorus
/// entity struct, updating its' held information when new information concerning itself arrives
/// over the [`Gateway`] connection, reducing the need for expensive network-API calls.
fn into_shared(self) -> Shared<Self>
where
Self: Sized,