summaryrefslogtreecommitdiff
path: root/core/resources.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/resources.rs')
-rw-r--r--core/resources.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/resources.rs b/core/resources.rs
index 5bec68481..6ca86e10b 100644
--- a/core/resources.rs
+++ b/core/resources.rs
@@ -154,6 +154,18 @@ pub trait Resource: Any + 'static {
})
}
+ /// The same as [`read_byob()`][Resource::read_byob], but synchronous.
+ fn read_byob_sync(&self, data: &mut [u8]) -> Result<usize, Error> {
+ _ = data;
+ Err(not_supported())
+ }
+
+ /// The same as [`write()`][Resource::write], but synchronous.
+ fn write_sync(&self, data: &[u8]) -> Result<usize, Error> {
+ _ = data;
+ Err(not_supported())
+ }
+
/// The shutdown method can be used to asynchronously close the resource. It
/// is not automatically called when the resource is dropped or closed.
///