diff --git a/src/lazy_load_blob.rs b/src/lazy_load_blob.rs new file mode 100644 index 0000000..8e4e65b --- /dev/null +++ b/src/lazy_load_blob.rs @@ -0,0 +1,16 @@ +pub use crate::LazyLoadBlob; + +impl std::default::Default for LazyLoadBlob { + fn default() -> Self { + LazyLoadBlob { + mime: None, + bytes: Vec::new(), + } + } +} + +impl std::cmp::PartialEq for LazyLoadBlob { + fn eq(&self, other: &Self) -> bool { + self.mime == other.mime && self.bytes == other.bytes + } +} diff --git a/src/lib.rs b/src/lib.rs index b6afa3a..9e351c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,6 +60,8 @@ mod on_exit; pub use on_exit::OnExit; mod capability; pub use capability::Capability; +mod lazy_load_blob; +pub use lazy_load_blob::LazyLoadBlob; /// Implement the wit-bindgen specific code that the kernel uses to hook into /// a process. Write an `init(our: Address)` function and call it with this. @@ -134,15 +136,6 @@ pub fn spawn( ) } -impl std::default::Default for LazyLoadBlob { - fn default() -> Self { - LazyLoadBlob { - mime: None, - bytes: Vec::new(), - } - } -} - /// Create a blob with no MIME type and a generic type, plus a serializer /// function that turns that type into bytes. ///