# Function client::decode_response

> Decodes a successful response body as the response type of command `B`.

`zaun_community_protocol::client::decode_response` · Function

```rust
pub fn decode_response<B>(body: &RawValue) -> Result<<B as >::Response>
```

Decodes a successful response body as the response type of command `B`.

```rust
let sent = decode_response::<message::Send>(&raw)?; // message::Sent
```

# Errors
The body does not match `B::Response`.

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/client/decode/fn.decode_response.html)
