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

# Stream.Event

Describes the constants that may be sent to the delegate as a bit field in the second parameter of [`stream(_:handle:)`](/documentation/Foundation/StreamDelegate/stream(_:handle:)) to specify the kind of stream event.

```
struct Event
```

## Topics

### Constants

[`NSStreamEventOpenCompleted`](/documentation/Foundation/Stream/Event/openCompleted)

The open has completed successfully.

[`NSStreamEventHasBytesAvailable`](/documentation/Foundation/Stream/Event/hasBytesAvailable)

The stream has bytes to be read.

[`NSStreamEventHasSpaceAvailable`](/documentation/Foundation/Stream/Event/hasSpaceAvailable)

The stream can accept bytes for writing.

[`NSStreamEventErrorOccurred`](/documentation/Foundation/Stream/Event/errorOccurred)

An error has occurred on the stream.

[`NSStreamEventEndEncountered`](/documentation/Foundation/Stream/Event/endEncountered)

The end of the stream has been reached.

[`NSStreamEventNone`](/documentation/Foundation/NSStreamEvent/NSStreamEventNone)

No event has occurred.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)