# Struct Role

> A role of a community.

`zaun_client::Role` · Struct

```rust
pub struct Role { … }
```

A role of a community.

## Methods

### `managed_by`

```rust
pub fn managed_by(&self) -> Option<BotId>
```

The bot whose managed role this is: only that bot holds it, and only the owner's
grants change it.

### `mention`

```rust
pub fn mention(&self) -> String
```

The text that shows a mention of this role, `<@&id>`.

### `id`

```rust
pub const fn id(&self) -> RoleId
```

Its id.

### `community`

```rust
pub const fn community(&self) -> &Community
```

The community it belongs to.

### `data`

```rust
pub fn data(&self) -> Option<RoleData>
```

The cache's copy, or `None` when the cache does not have it.

### `name`

```rust
pub fn name(&self) -> String
```

Its name (empty when the cache does not have it).

### `permissions`

```rust
pub fn permissions(&self) -> Permissions
```

Its permissions.

### `delete`

```rust
pub fn delete(&self) -> Result<()>
```

Deletes the role.

# Errors
The host refused or did not answer.

## Trait implementations

`Clone`, `Debug`, `Display`, `PartialEq`

[Full rustdoc page](/docs/api/rust/zaun-client/zaun_client/objects/struct.Role.html)
