<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMachPort/Options",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSMachPortOptions"
  },
  "title" : "NSMachPort.Options"
}
-->

# NSMachPort.Options

Used to remove access rights to a mach port when the `NSMachPort` object is invalidated or destroyed.

```
struct Options
```

## Topics

### Constants

[`NSMachPortDeallocateNone`](/documentation/Foundation/NSMachPortOptions/NSMachPortDeallocateNone)

Do not remove any send or receive rights.

[`NSMachPortDeallocateReceiveRight`](/documentation/Foundation/NSMachPort/Options/deallocateReceiveRight)

Remove a receive right when the `NSMachPort` object is invalidated or destroyed.

[`NSMachPortDeallocateSendRight`](/documentation/Foundation/NSMachPort/Options/deallocateSendRight)

Deallocate a send right when the `NSMachPort` object is invalidated or destroyed.

## Relationships

### Conforms To

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`Sendable`](/documentation/Swift/Sendable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`OptionSet`](/documentation/Swift/OptionSet)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)