pub struct AppIdAssignerNames<'a, F: Fn(&'static str) -> u32> { /* private fields */ }
Expand description
A sample AppID Assignment tool that assigns pseudo-unique AppIDs and ShortIds based on the process name.
ShortIds are assigned as a non-secure hash of the process name.
§Usage
ⓘ
let assigner = static_init!(
kernel::process_checker::basic::AppIdAssignerNames<fn(&'static str) -> u32>,
kernel::process_checker::basic::AppIdAssignerNames::new(
&((|s| { kernel::utilities::helpers::crc32_posix(s.as_bytes()) })
as fn(&'static str) -> u32)
)
);
Implementations§
Trait Implementations§
Source§impl<F: Fn(&'static str) -> u32> AppUniqueness for AppIdAssignerNames<'_, F>
impl<F: Fn(&'static str) -> u32> AppUniqueness for AppIdAssignerNames<'_, F>
Source§fn different_identifier(
&self,
process_a: &ProcessBinary,
process_b: &ProcessBinary,
) -> bool
fn different_identifier( &self, process_a: &ProcessBinary, process_b: &ProcessBinary, ) -> bool
Returns whether
process_a
and process_b
have a different identifier,
and so can run concurrently. If this returns false
, the kernel
will not run process_a
and process_b
at the same time.Source§fn different_identifier_process(
&self,
process_a: &ProcessBinary,
process_b: &dyn Process,
) -> bool
fn different_identifier_process( &self, process_a: &ProcessBinary, process_b: &dyn Process, ) -> bool
Returns whether
process_a
and process_b
have a different identifier,
and so can run concurrently. If this returns false
, the kernel
will not run process_a
and process_b
at the same time.Source§impl<F: Fn(&'static str) -> u32> Compress for AppIdAssignerNames<'_, F>
impl<F: Fn(&'static str) -> u32> Compress for AppIdAssignerNames<'_, F>
Source§fn to_short_id(&self, process: &ProcessBinary) -> ShortId
fn to_short_id(&self, process: &ProcessBinary) -> ShortId
Auto Trait Implementations§
impl<'a, F> Freeze for AppIdAssignerNames<'a, F>
impl<'a, F> RefUnwindSafe for AppIdAssignerNames<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for AppIdAssignerNames<'a, F>where
F: Sync,
impl<'a, F> Sync for AppIdAssignerNames<'a, F>where
F: Sync,
impl<'a, F> Unpin for AppIdAssignerNames<'a, F>
impl<'a, F> UnwindSafe for AppIdAssignerNames<'a, F>where
F: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more