Skip to main content

ezsp/frame/parameters/binding/
clear_table.rs

1//! Parameters for the [`Binding::clear_binding_table`](crate::Binding::clear_table) command.
2
3use num_traits::FromPrimitive;
4
5use crate::Error;
6use crate::ember::Status;
7
8crate::frame::parameters::frame!(
9    0x002A,
10    {},
11    { status: u8 } => Binding(binding)::ClearTable,
12    impl {
13        /// Convert the response into a [`Result<()>`](crate::Result) by evaluating its status field.
14        impl TryFrom<Response> for () {
15            type Error = Error;
16
17            fn try_from(response: Response) -> Result<Self, Self::Error> {
18                match Status::from_u8(response.status).ok_or(response.status) {
19                    Ok(Status::Success) => Ok(()),
20                    other => Err(other.into()),
21                }
22            }
23        }
24    }
25);