Auditable

Enum Auditable 

Source
pub enum Auditable<'a> {
Show 16 variants AuditContext(&'a [Auditable<'a>]), Bug(u64), CurrentTask, DirEntry(&'a DirEntry), FileObject(&'a FileObject), FileSystem(&'a FileSystem), FsNode(&'a FsNode), IoctlCommand(u16), Location(&'a Location<'a>), Name(&'a FsStr), NamespaceNode(&'a NamespaceNode), NlMsgtype(u16), None, SockOptArguments(u32, u32), Task(&'a Task), TodoCheck,
}
Expand description

Container for a reference to kernel state from which to include details when emitting audit logging. Auditable instances are created from references to objects via into(), e.g:

fn my_lovely_hook(current_task: &CurrentTask, …) { let audit_context = current_task.into(); check_permission(…, audit_context) }

Call-sites which need to include context from multiple sources into audit logs can do so by creating an array of Auditable instances from those sources, and using into() to create an Auditable from a reference to that array, e.g:

fn my_lovelier_hook(current_task: &CurrentTask,…, audit_context: Auditable<’_>) { let audit_context = [audit_context, current_task.into()]; check_permission(…, (&audit_context).into()) }

Auditable instances are parameterized with the lifetime of the references they contain, which will be automagically derived by Rust. Since they only consist of a type discriminator and reference they are cheap to copy, avoiding the need to pass them by-reference if the same context is to be applied to multiple permission checks.

Variants§

§

AuditContext(&'a [Auditable<'a>])

§

Bug(u64)

§

CurrentTask

§

DirEntry(&'a DirEntry)

§

FileObject(&'a FileObject)

§

FileSystem(&'a FileSystem)

§

FsNode(&'a FsNode)

§

IoctlCommand(u16)

§

Location(&'a Location<'a>)

§

Name(&'a FsStr)

§

NamespaceNode(&'a NamespaceNode)

§

NlMsgtype(u16)

§

None

§

SockOptArguments(u32, u32)

§

Task(&'a Task)

§

TodoCheck

Trait Implementations§

Source§

impl<'a> Clone for Auditable<'a>

Source§

fn clone(&self) -> Auditable<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Display for Auditable<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, const N: usize> From<&'a [Auditable<'a>; N]> for Auditable<'a>

Source§

fn from(value: &'a [Auditable<'a>; N]) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Arc<DirEntry>> for Auditable<'a>

Source§

fn from(value: &'a DirEntryHandle) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a CurrentTask> for Auditable<'a>

Source§

fn from(_value: &'a CurrentTask) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a DirEntry> for Auditable<'a>

Source§

fn from(value: &'a DirEntry) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a FileObject> for Auditable<'a>

Source§

fn from(value: &'a FileObject) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a FileSystem> for Auditable<'a>

Source§

fn from(value: &'a FileSystem) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a FsNode> for Auditable<'a>

Source§

fn from(value: &'a FsNode) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Location<'a>> for Auditable<'a>

Source§

fn from(value: &'a Location<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a NamespaceNode> for Auditable<'a>

Source§

fn from(value: &'a NamespaceNode) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Task> for Auditable<'a>

Source§

fn from(value: &'a Task) -> Self

Converts to this type from the input type.
Source§

impl<'a> Copy for Auditable<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Auditable<'a>

§

impl<'a> !RefUnwindSafe for Auditable<'a>

§

impl<'a> Send for Auditable<'a>

§

impl<'a> Sync for Auditable<'a>

§

impl<'a> Unpin for Auditable<'a>

§

impl<'a> !UnwindSafe for Auditable<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> InstanceFromServiceTransport<T> for T

§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to [Self]
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> Into32<U> for T
where U: MultiArchFrom<T>,

Source§

fn into_32(self) -> U

Source§

impl<T, U> Into64<U> for T
where U: MultiArchFrom<T>,

Source§

fn into_64(self) -> U

Source§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

Source§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T, U> IntoExt<U> for T
where U: FromExt<T>,

§

fn into_ext(self) -> U

Performs the conversion.
Source§

impl<T, U> IntoFidl<U> for T
where U: FromFidl<T>,

Source§

fn into_fidl(self) -> U

Source§

impl<T, U> MultiArchFrom<T> for U
where U: From<T>,

Source§

fn from_64(value: T) -> U

Source§

fn from_32(value: T) -> U

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> TryIntoExt<U> for T
where U: TryFromExt<T>,

§

type Error = <U as TryFromExt<T>>::Error

§

fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>

Tries to perform the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> VertexId for T
where T: Display,

§

fn get_id(&self) -> Cow<'_, str>

Fetches the ID of a vertex, which must have a string representation.
§

impl<St> WithTag for St

§

fn tagged<T>(self, tag: T) -> Tagged<T, St>

Produce a new stream from this one which yields item tupled with a constant tag
Source§

impl<B, A> LockBefore<B> for A
where B: LockAfter<A>,

Source§

impl<B, A> LockEqualOrBefore<B> for A
where A: LockBefore<B>,

§

impl<E> RunsTransport<Mpsc> for E

§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,