Instance Propertynmggithub.kass 3.2.4MachCore
body
The message body.
var body: Mach.MessageBody?
The message body.
var body: Mach.MessageBody?
import MachCore
The core module for interacting with the Mach kernel.
class Message
A message.
struct Mach
The Mach kernel.
struct MessageBody
A body of message descriptors.
required init(descriptors: [any Mach.MessageDescriptor]? = nil, payloadBytes: UnsafeRawBufferPointer? = nil)
Creates a message with a set of descriptors and a payload.
required init(headerPointer: UnsafeMutablePointer<mach_msg_header_t>)
Deserializes an existing message from a header pointer.
static func message(_ messageBuffer: UnsafeMutablePointer<mach_msg_header_t>, options: Mach.MessageOptions = [], sendSize: mach_msg_size_t, receiveSize: mach_msg_size_t, receivePort: Mach.Port = Mach.Port.Nil, timeout: mach_msg_timeout_t = MACH_MSG_TIMEOUT_NONE, notifyPort: Mach.Port = Mach.Port.Nil) throws
Calls the mach_msg
kernel call.
static func receive<ReceiveMessage>(_ messageType: ReceiveMessage.Type = Mach.Message.self, ofMaxSize maxSize: Int = Mach.Message.defaultMaxReceiveSize, from localPort: Mach.Port, options: consuming Mach.MessageOptions = [], timeout: mach_msg_timeout_t = MACH_MSG_TIMEOUT_NONE) throws -> ReceiveMessage where ReceiveMessage : Mach.Message
Receives a message.
static func send(_ message: Mach.Message, to remotePort: Mach.Port? = nil, options: consuming Mach.MessageOptions = [], timeout: mach_msg_timeout_t = MACH_MSG_TIMEOUT_NONE) throws
Sends a message.
static func send<ReceiveMessage>(_ message: Mach.Message, to remotePort: Mach.Port? = nil, receiving receiveType: ReceiveMessage.Type, ofMaxSize maxSize: Int = Mach.Message.defaultMaxReceiveSize, from receivePort: Mach.Port? = nil, options: consuming Mach.MessageOptions = [], timeout: mach_msg_timeout_t = 0) throws -> ReceiveMessage where ReceiveMessage : Mach.Message
Sends a message and receive a message.
var header: mach_msg_header_t
The message header.
var payload: UnsafeRawBufferPointer?
The message payload buffer.
var trailer: mach_msg_max_trailer_t?
The message trailer.
func serialize() -> UnsafeMutablePointer<mach_msg_header_t>
Allocates a message buffer, serializes it with the message contents, and returns a header pointer.