This commit is contained in:
Max Goedjen 2022-01-01 22:34:00 -08:00
parent 401e5c8d41
commit 37c39767b5
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8

View File

@ -1,15 +1,21 @@
import Foundation import Foundation
/// Protocol abstraction of the reading aspects of FileHandle.
public protocol FileHandleReader { public protocol FileHandleReader {
/// Gets data that is available for reading.
var availableData: Data { get } var availableData: Data { get }
/// A file descriptor of the handle.
var fileDescriptor: Int32 { get } var fileDescriptor: Int32 { get }
/// The process ID of the process coonnected to the other end of the FileHandle.
var pidOfConnectedProcess: Int32 { get } var pidOfConnectedProcess: Int32 { get }
} }
/// Protocol abstraction of the writing aspects of FileHandle.
public protocol FileHandleWriter { public protocol FileHandleWriter {
/// Writes data to the handle.
func write(_ data: Data) func write(_ data: Data)
} }