Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/squeue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 {
Expand Down Expand Up @@ -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]
Expand All @@ -390,13 +416,25 @@ 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]
pub fn personality(mut self, personality: u16) -> 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 {}
Expand Down
Loading