diff --git a/src/squeue.rs b/src/squeue.rs index 29b78f3..ea06832 100644 --- a/src/squeue.rs +++ b/src/squeue.rs @@ -328,6 +328,13 @@ impl Entry { self } + /// Clear the submission event's [flags](Flags). + #[inline] + pub fn clear_flags(mut self) -> Entry { + self.0.flags = 0; + self + } + /// Set the user data. This is an application-supplied value that will be passed straight /// through into the [completion queue entry](crate::cqueue::Entry::user_data). #[inline] @@ -336,12 +343,24 @@ impl Entry { self } + /// Set the user_data without consuming the entry. + #[inline] + pub fn set_user_data(&mut self, user_data: u64) { + self.0.user_data = user_data; + } + /// Get the previously application-supplied user data. #[inline] pub fn get_user_data(&self) -> u64 { self.0.user_data } + /// Get the opcode associated with this entry. + #[inline] + pub fn get_opcode(&self) -> u32 { + self.0.opcode.into() + } + /// Set the personality of this event. You can obtain a personality using /// [`Submitter::register_personality`](crate::Submitter::register_personality). pub fn personality(mut self, personality: u16) -> Entry { @@ -382,6 +401,13 @@ impl Entry128 { self } + /// Clear the submission event's [flags](Flags). + #[inline] + pub fn clear_flags(mut self) -> Entry128 { + self.0 .0.flags = 0; + self + } + /// Set the user data. This is an application-supplied value that will be passed straight /// through into the [completion queue entry](crate::cqueue::Entry::user_data). #[inline] @@ -390,6 +416,12 @@ impl Entry128 { self } + /// Set the user data without consuming the entry. + #[inline] + pub fn set_user_data(&mut self, user_data: u64) { + self.0 .0.user_data = user_data; + } + /// Set the personality of this event. You can obtain a personality using /// [`Submitter::register_personality`](crate::Submitter::register_personality). #[inline] @@ -397,6 +429,12 @@ impl Entry128 { self.0 .0.personality = personality; self } + + /// Get the opcode associated with this entry. + #[inline] + pub fn get_opcode(&self) -> u32 { + self.0 .0.opcode.into() + } } impl private::Sealed for Entry128 {}