aws_smithy_runtime_api::shared

Function maybe_shared

Source
pub fn maybe_shared<Shared, MaybeShared, F>(
    value: MaybeShared,
    ctor: F,
) -> Shared
where Shared: 'static, MaybeShared: IntoShared<Shared> + 'static, F: FnOnce(MaybeShared) -> Shared,
Expand description

Given a value, determine if that value is already shared. If it is, return it. Otherwise, wrap it in a shared type.

See the module docs for information about shared types.