3434/// accesses to a value using the lock. But it's easy to forget to actually
3535/// acquire/release the lock in the correct place. ``NIOLockedValueBox`` makes
3636/// that much easier.
37- public struct NIOLockedValueBox < Value> {
37+ @usableFromInline
38+ struct NIOLockedValueBox < Value> {
3839
3940 @usableFromInline
4041 internal let _storage : LockStorage < Value >
4142
4243 /// Initialize the `Value`.
4344 @inlinable
44- public init ( _ value: Value ) {
45+ init ( _ value: Value ) {
4546 self . _storage = . create( value: value)
4647 }
4748
4849 /// Access the `Value`, allowing mutation of it.
4950 @inlinable
50- public func withLockedValue< T> ( _ mutate: ( inout Value ) throws -> T ) rethrows -> T {
51+ func withLockedValue< T> ( _ mutate: ( inout Value ) throws -> T ) rethrows -> T {
5152 try self . _storage. withLockedValue ( mutate)
5253 }
5354
@@ -56,24 +57,24 @@ public struct NIOLockedValueBox<Value> {
5657 /// This can be beneficial when you require fine grained control over the lock in some
5758 /// situations but don't want lose the benefits of ``withLockedValue(_:)`` in others by
5859 /// switching to ``NIOLock``.
59- public var unsafe : Unsafe {
60+ var unsafe : Unsafe {
6061 Unsafe ( _storage: self . _storage)
6162 }
6263
6364 /// Provides an unsafe view over the lock and its value.
64- public struct Unsafe {
65+ struct Unsafe {
6566 @usableFromInline
6667 let _storage : LockStorage < Value >
6768
6869 /// Manually acquire the lock.
6970 @inlinable
70- public func lock( ) {
71+ func lock( ) {
7172 self . _storage. lock ( )
7273 }
7374
7475 /// Manually release the lock.
7576 @inlinable
76- public func unlock( ) {
77+ func unlock( ) {
7778 self . _storage. unlock ( )
7879 }
7980
@@ -82,7 +83,7 @@ public struct NIOLockedValueBox<Value> {
8283 /// - Parameter mutate: A closure with scoped access to the value.
8384 /// - Returns: The result of the `mutate` closure.
8485 @inlinable
85- public func withValueAssumingLockIsAcquired< Result> (
86+ func withValueAssumingLockIsAcquired< Result> (
8687 _ mutate: ( _ value: inout Value ) throws -> Result
8788 ) rethrows -> Result {
8889 try self . _storage. withUnsafeMutablePointerToHeader { value in
0 commit comments