pub struct RwSubscription<'a> {
pub file: &'a dyn WasiFile,
/* private fields */
}
59
60
61
62
63
64
65
66
pub fn subscribe_read(&mut self, file: &'a dyn WasiFile, ud: Userdata) {
self.subs
.push((Subscription::Read(RwSubscription::new(file)), ud));
}
pub fn subscribe_write(&mut self, file: &'a dyn WasiFile, ud: Userdata) {
self.subs
.push((Subscription::Write(RwSubscription::new(file)), ud));
}
src/sched/subscription.rs (
line 71)
69
70
71
72
73
74
75
pub fn from_subscription(s: Subscription) -> Option<SubscriptionResult> {
match s {
Subscription::Read(mut s) => s.result().map(SubscriptionResult::Read),
Subscription::Write(mut s) => s.result().map(SubscriptionResult::Write),
Subscription::MonotonicClock(s) => s.result().map(SubscriptionResult::MonotonicClock),
}
}
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Instruments this type with the provided
Span
, returning an
Instrumented
wrapper.
Read more
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.