Home
last modified time | relevance | path

Searched refs:TryRecvError (Results 1 – 7 of 7) sorted by relevance

/ohos5.0/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/
H A Derror.rs65 pub enum TryRecvError { enum
72 impl Display for TryRecvError { implementation
75 TryRecvError::Empty => write!(f, "channel is empty"), in fmt()
76 TryRecvError::Closed => write!(f, "channel is closed"), in fmt()
81 impl Error for TryRecvError {} implementation
128 use crate::sync::error::{RecvError, RecvTimeoutError, TryRecvError};
140 let try_recv_err1 = TryRecvError::Empty; in ut_test_sync_error_display()
142 let try_recv_err2 = TryRecvError::Closed; in ut_test_sync_error_display()
H A Doneshot.rs53 use super::error::{RecvError, TryRecvError};
326 pub fn try_recv(&mut self) -> Result<T, TryRecvError> { in try_recv() argument
328 INIT => Err(TryRecvError::Empty), in try_recv()
332 .map_err(|_| TryRecvError::Closed), in try_recv()
333 CLOSED => Err(TryRecvError::Closed), in try_recv()
465 use crate::sync::error::TryRecvError;
478 assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); in send_try_recv()
482 assert_eq!(rx.try_recv(), Err(TryRecvError::Closed)); in send_try_recv()
/ohos5.0/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/mpsc/bounded/
H A Darray.rs24 use crate::sync::error::{RecvError, SendError, TryRecvError, TrySendError};
142 pub(crate) fn try_recv(&self) -> Result<T, TryRecvError> { in try_recv() argument
161 Err(TryRecvError::Closed) in try_recv()
163 Err(TryRecvError::Empty) in try_recv()
171 Err(TryRecvError::Closed) => return Ready(Err(RecvError)), in poll_recv()
172 Err(TryRecvError::Empty) => {} in poll_recv()
179 Err(TryRecvError::Closed) => Ready(Err(RecvError)), in poll_recv()
180 Err(TryRecvError::Empty) => Pending, in poll_recv()
H A Dmod.rs21 use crate::sync::error::{RecvError, SendError, TryRecvError, TrySendError};
377 pub fn try_recv(&mut self) -> Result<T, TryRecvError> { in try_recv() argument
/ohos5.0/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/mpsc/unbounded/
H A Dqueue.rs24 use crate::sync::error::{RecvError, SendError, TryRecvError};
185 pub(crate) fn try_recv(&self) -> Result<T, TryRecvError> { in try_recv() argument
212 Err(TryRecvError::Closed) in try_recv()
214 Err(TryRecvError::Empty) in try_recv()
222 Err(TryRecvError::Closed) => return Ready(Err(RecvError)), in poll_recv()
230 Err(TryRecvError::Closed) => Ready(Err(RecvError)), in poll_recv()
231 Err(TryRecvError::Empty) => Pending, in poll_recv()
H A Dmod.rs21 use crate::sync::error::{RecvError, SendError, TryRecvError};
259 pub fn try_recv(&mut self) -> Result<T, TryRecvError> { in try_recv() argument
/ohos5.0/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/
H A Dmpsc_test.rs18 use ylong_runtime::sync::error::{RecvError, RecvTimeoutError, TryRecvError, TrySendError};
69 assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); in sdv_unbounded_send_try_recv_test()
73 assert_eq!(rx.try_recv(), Err(TryRecvError::Closed)); in sdv_unbounded_send_try_recv_test()
150 assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); in sdv_bounded_try_send_try_recv_test()
155 assert_eq!(rx.try_recv(), Err(TryRecvError::Closed)); in sdv_bounded_try_send_try_recv_test()