pub struct TryingThroughMutex<T>(pub Arc<Mutex<T>>);Expand description
Helper struct that accesses a TypeRenderable intrough an Arc<Mutex<_>>, thus allowing easiy
simultaneous access.
When implementing SimpelCBORHandler, it does not wait for the lock, but rather fails with a 5.03 Service Unavailable that usually prompts the client to retry. Note that this will not happen ever if the items are just accessed through different paths on the same handler, and neither will be if they are only ever locked outside the CoAP server’s main loop. (And even then, unless they’re locked for long, it’s very unlikely to be hit by chance).
TBD: Send a “Max-Age: 0” option along to indicate that the client can try again right away rather than wait the usual 60 seconds.
TBD: This may be a nice addition to the coap_handler crate in general (but needs the
introduction of a std feature there).
Tuple Fields§
§0: Arc<Mutex<T>>Trait Implementations§
Source§impl<T: DeleteRenderable> DeleteRenderable for TryingThroughMutex<T>
Available on crate feature std only.
impl<T: DeleteRenderable> DeleteRenderable for TryingThroughMutex<T>
std only.Source§impl<T: FetchRenderable> FetchRenderable for TryingThroughMutex<T>
Available on crate feature std only.
impl<T: FetchRenderable> FetchRenderable for TryingThroughMutex<T>
std only.Source§impl<T: GetRenderable> GetRenderable for TryingThroughMutex<T>
Available on crate feature std only.
impl<T: GetRenderable> GetRenderable for TryingThroughMutex<T>
std only.Source§impl<T: IPatchRenderable> IPatchRenderable for TryingThroughMutex<T>
Available on crate feature std only.
impl<T: IPatchRenderable> IPatchRenderable for TryingThroughMutex<T>
std only.Source§impl<T: PostRenderable> PostRenderable for TryingThroughMutex<T>
Available on crate feature std only.
impl<T: PostRenderable> PostRenderable for TryingThroughMutex<T>
std only.Source§impl<T: PutRenderable> PutRenderable for TryingThroughMutex<T>
Available on crate feature std only.
impl<T: PutRenderable> PutRenderable for TryingThroughMutex<T>
std only.impl<T: TypeRenderable> TypeRenderable for TryingThroughMutex<T>
std only.