---
title: AnySubscriber
framework: combine
role: symbol
role_heading: Structure
path: combine/anysubscriber
---

# AnySubscriber

A type-erasing subscriber.

## Declaration

```swift
@frozen struct AnySubscriber<Input, Failure> where Failure : Error
```

## Overview

Overview Use an AnySubscriber to wrap an existing subscriber whose details you don’t want to expose. You can also use AnySubscriber to create a custom subscriber by providing closures for the methods defined in Subscriber, rather than implementing Subscriber directly.

## Topics

### Creating a type-erased subscriber

- [init(_:)](combine/anysubscriber/init(_:)-2dbfs.md)
- [init(_:)](combine/anysubscriber/init(_:)-3t3eh.md)
- [init(receiveSubscription:receiveValue:receiveCompletion:)](combine/anysubscriber/init(receivesubscription:receivevalue:receivecompletion:).md)

## Relationships

### Conforms To

- [CustomCombineIdentifierConvertible](combine/customcombineidentifierconvertible.md)
- [CustomPlaygroundDisplayConvertible](swift/customplaygrounddisplayconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Subscriber](combine/subscriber.md)

## See Also

### Subscribers

- [Processing Published Elements with Subscribers](combine/processing-published-elements-with-subscribers.md)
- [Subscriber](combine/subscriber.md)
- [Subscribers](combine/subscribers.md)
- [Subscription](combine/subscription.md)
- [Subscriptions](combine/subscriptions.md)
