bytesbuf/
memory_shared.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4use crate::Memory;
5
6/// Provides memory for byte sequences in a thread-safe manner.
7///
8/// This is a narrowing of [`Memory`] that adds additional constraints that enable
9/// thread-safe shared access to the memory provider. If you do not need these extra
10/// constraints, just use [`Memory`] directly.
11pub trait MemoryShared: Memory + Send + Sync + 'static {}
12
13impl<T> MemoryShared for T where T: Memory + Send + Sync + 'static {}