# ChannelDescriptor

## pub struct ChannelDescriptor

A descriptor for a channel.

Note that this is used internally to compare channels.

## Fields

### pub name: String

The name of the channel.

### pub tags: Option<Arc<BTreeMap<String, String>>>

The tags associated with the channel, if any.

Shared rather than owned: a wide record is thousands of channels written at one timestamp
all carrying the same tags, so a descriptor per channel would otherwise mean copying the
same map thousands of times per write.

## Implementations

### impl ChannelDescriptor

#### pub fn new(name: impl Into<String>) -> Self

Creates a new channel descriptor from the given `name`.

If you would like to include tags, see also [`Self::with_tags`](https://dev.nominal.io/nominal-streaming/ref/rust/nominal_streaming/types/struct.ChannelDescriptor.md#method.with_tags "nominal_streaming::types::ChannelDescriptor::with_tags").

#### pub fn with_tags(name: impl Into<String>, tags: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>) -> Self

Creates a new channel descriptor from the given `name` and `tags`.

## Trait implementations

**Derived**: [`Clone`](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html), [`Debug`](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html), [`Eq`](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Eq.html), [`Hash`](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html), [`StructuralPartialEq`](https://doc.rust-lang.org/1.98.1/core/marker/trait.StructuralPartialEq.html), [`PartialEq`](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html), [`Ord`](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html), [`PartialOrd`](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html)

**Auto traits**: [`Send`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html), [`Sync`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html), [`Unpin`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Unpin.html), [`UnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.UnwindSafe.html), [`RefUnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.RefUnwindSafe.html)
