mirror of
https://github.com/apple/container.git
synced 2026-09-09 01:05:40 +00:00
Source code documentation updates (#9)
This change adds documentation to quite a few existing public types that didn't have a blurb before. Additionally, this fixes a couple things that I think either didn't make sense when going to document them: - Rename ConnectionStream to VsockConnectionStream. This type only functions for vsock connections. - Deletes NsLock+Closure. This was not used anywhere. - Rename ContainerizationOCI/Config.swift to ImageConfig.swift. Signed-off-by: Danny Canter <danny_canter@apple.com>
This commit is contained in:
@@ -44,6 +44,7 @@ let sysConnect = connect
|
||||
let sysIoctl: @convention(c) (CInt, CUnsignedLong, UnsafeMutableRawPointer) -> CInt = ioctl
|
||||
#endif
|
||||
|
||||
/// Thread-safe socket wrapper.
|
||||
public final class Socket: Sendable {
|
||||
public enum TimeoutOption {
|
||||
case send
|
||||
|
||||
@@ -24,6 +24,7 @@ import Darwin
|
||||
#error("SocketType not supported on this platform.")
|
||||
#endif
|
||||
|
||||
/// Protocol used to describe the family of socket to be created with `Socket`.
|
||||
public protocol SocketType: Sendable, CustomStringConvertible {
|
||||
var domain: Int32 { get }
|
||||
var type: Int32 { get }
|
||||
|
||||
@@ -27,6 +27,7 @@ let _SOCK_STREAM = SOCK_STREAM
|
||||
#error("UnixType not supported on this platform.")
|
||||
#endif
|
||||
|
||||
/// Unix domain socket variant of `SocketType`.
|
||||
public struct UnixType: SocketType, Sendable, CustomStringConvertible {
|
||||
public var domain: Int32 { AF_UNIX }
|
||||
public var type: Int32 { _SOCK_STREAM }
|
||||
|
||||
@@ -26,6 +26,7 @@ import Darwin
|
||||
#error("VsockType not supported on this platform.")
|
||||
#endif
|
||||
|
||||
/// Vsock variant of `SocketType`.
|
||||
public struct VsockType: SocketType, Sendable {
|
||||
public var domain: Int32 { AF_VSOCK }
|
||||
public var type: Int32 { _SOCK_STREAM }
|
||||
|
||||
Reference in New Issue
Block a user