# Channels

A [channel](https://dev.nominal.io/platform/data-model.md#channels) is one named signal in a [dataset](https://dev.nominal.io/rust-client/guides/datasets.md), such as `altitude`. It has a data type, and can have a unit and a description.

To use this page, first make sure you can [Connect to Nominal](https://dev.nominal.io/rust-client/guides/connect.md) and obtain a `client`.

## Fetch a channel

If the dataset’s RID and the channel’s name are known, you can fetch that channel directly without needing to search.

```rust
let altitude = client.catalog().get_channel("<ri.catalog.instance.dataset.identifier>", "altitude").await?;
```

## Find channels

```rust
// Every channel in the dataset
for channel in client.catalog().list_channels("<ri.catalog.instance.dataset.identifier>").await? {
    println!("{} {:?} {}", channel.name(), channel.data_type(), channel.unit().unwrap_or(""));
}
```

To find only some of a dataset’s channels, give [`search_channels`](https://dev.nominal.io/rust-client/ref/rust/nominal/core/struct.CatalogClient.md#method.search_channels "nominal::core::CatalogClient::search_channels") filters that all have to match:

```rust
use nominal::core::{ChannelDataType, ChannelQuery};

// Floating-point channels with "temp" in their names, in any case
let channels = client
    .catalog()
    .search_channels(
        ChannelQuery::new()
            .data_source("<ri.catalog.instance.dataset.identifier>")
            .substring_match("temp")
            .data_type(ChannelDataType::Double),
    )
    .await?;
```

## Set units and descriptions

[`set_channel_metadata`](https://dev.nominal.io/rust-client/ref/rust/nominal/core/struct.CatalogClient.md#method.set_channel_metadata "nominal::core::CatalogClient::set_channel_metadata") sets a channel’s unit and description, without changing its data:

```rust
use nominal::core::{ChannelDataType, ChannelUpdate};

client
    .catalog()
    .set_channel_metadata(
        "<ri.catalog.instance.dataset.identifier>",
        "altitude",
        ChannelUpdate::new(ChannelDataType::Double).unit("m").description("Barometric altitude"),
    )
    .await?;
```
