---
title: Result
framework: swift
role: symbol
role_heading: Enumeration
path: swift/result
---

# Result

A value that represents either a success or a failure, including an associated value in each case.

## Declaration

```swift
@frozen enum Result<Success, Failure> where Failure : Error, Success : ~Copyable, Success : ~Escapable
```

## Mentioned in

Preserving the Results of a Throwing Expression Writing Failable Asynchronous APIs

## Topics

### Representing a Result

- [Result.success(_:)](swift/result/success(_:).md)
- [Result.failure(_:)](swift/result/failure(_:).md)
- [Writing Failable Asynchronous APIs](swift/writing-failable-asynchronous-apis.md)

### Converting a Throwing Expression to a Result

- [Preserving the Results of a Throwing Expression](swift/preserving-the-results-of-a-throwing-expression.md)
- [init(catching:)](swift/result/init(catching:).md)

### Converting a Result to a Throwing Expression

- [get()](swift/result/get().md)

### Transforming a Result

- [map(_:)](swift/result/map(_:).md)
- [mapError(_:)](swift/result/maperror(_:).md)
- [flatMap(_:)](swift/result/flatmap(_:).md)
- [flatMapError(_:)](swift/result/flatmaperror(_:).md)

### Comparing Results

- [==(_:_:)](swift/result/==(_:_:).md)
- [!=(_:_:)](swift/result/!=(_:_:).md)

### Publishing a Result

- [publisher](swift/result/publisher-swift.property.md)
- [Result.Publisher](swift/result/publisher-swift.struct.md)

### Default Implementations

- [Equatable Implementations](swift/result/equatable-implementations.md)
- [Hashable Implementations](swift/result/hashable-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [PromptRepresentable](foundationmodels/promptrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Errors

- [Error](swift/error.md)
