# server.Server.set_typed_option

- **Module:** server.Server
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/server/settings.rs#L125
- **Page:** https://libtmux.org/en/rs/latest/reference/server-server-set_typed_option/

```
server.Server.set_typed_option(self, name: &str, value: impl Into<OptionValue>) -> Result<(), Error>
```

Set one server option to a typed value, checked before it is sent.

The value must be the variant [`Self::typed_option`] reads back for
the option; [`OptionValue`] gives the rules, and what is not checked.

# Errors

Returns [`Error::OptionValueRefused`] without sending anything when
tmux's option table refuses the value, and
[`Error::OptionScopeMismatch`] when the option is not a server option.
Otherwise returns an error when tmux rejects the name or value.

## Example

```rust
server.set_typed_option("escape-time", 10).await?;
```
