use coap_message::MessageOption;
pub struct Location<M>(pub M) where M: coap_message::ReadableMessage;
impl<M> crate::accessor::CriRef for Location<M>
where
M: coap_message::ReadableMessage
{
type Scheme = !;
type Host = !;
type PathIter<'a> = impl Iterator<Item=&'a str>;
type QueryIter<'a> = impl Iterator<Item=&'a str>;
fn path(&self) -> Self::PathIter<'_> {
self.0.options()
.filter(|o| o.number() == coap_numbers::option::LOCATION_PATH)
.filter_map(|o| core::str::from_utf8(o.value()).ok())
}
fn fragment(&self) -> Option<&str> {
None
}
}