falco_event::fields

Trait FromBytes

Source
pub trait FromBytes<'a>: Sized {
    // Required method
    fn from_bytes(buf: &mut &'a [u8]) -> FromBytesResult<Self>;

    // Provided method
    fn from_maybe_bytes(buf: Option<&mut &'a [u8]>) -> FromBytesResult<Self> { ... }
}
Expand description

Deserialize a field from a byte buffer

Required Methods§

Source

fn from_bytes(buf: &mut &'a [u8]) -> FromBytesResult<Self>

Read the binary representation of a field and return the parsed representation

Note: the argument is a mutable reference to an immutable slice. While the contents of the slice cannot be modified, the slice itself can. Every call to from_bytes consumes a number of bytes from the beginning of the slice.

Provided Methods§

Source

fn from_maybe_bytes(buf: Option<&mut &'a [u8]>) -> FromBytesResult<Self>

Read the binary representation of a field from a buffer that may or may not exist

The default implementation returns an error when the buffer does not exist, but the blanket impl for Option<T> effectively returns Ok(None)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromBytes<'_> for (Ipv4Addr, Port)

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>

Source§

impl FromBytes<'_> for (Ipv6Addr, Port)

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>

Source§

impl FromBytes<'_> for bool

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>

Source§

impl FromBytes<'_> for i8

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl FromBytes<'_> for i16

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl FromBytes<'_> for i32

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl FromBytes<'_> for i64

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl FromBytes<'_> for u8

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl FromBytes<'_> for u16

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl FromBytes<'_> for u32

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl FromBytes<'_> for u64

Source§

fn from_bytes(buf: &mut &[u8]) -> FromBytesResult<Self>
where Self: Sized,

Source§

impl<'a> FromBytes<'a> for &'a CStr

Source§

fn from_bytes(buf: &mut &'a [u8]) -> FromBytesResult<Self>

Source§

impl<'a> FromBytes<'a> for &'a [u8]

Source§

fn from_bytes(buf: &mut &'a [u8]) -> FromBytesResult<Self>

Source§

impl<'a> FromBytes<'a> for Vec<&'a CStr>

Source§

fn from_bytes(buf: &mut &'a [u8]) -> FromBytesResult<Self>

Source§

impl<'a> FromBytes<'a> for Vec<(&'a CStr, &'a CStr)>

Source§

fn from_bytes(buf: &mut &'a [u8]) -> FromBytesResult<Self>

Source§

impl<'a, T> FromBytes<'a> for Option<T>
where T: Sized + FromBytes<'a> + 'a,

Source§

fn from_bytes(buf: &mut &'a [u8]) -> FromBytesResult<Self>

Source§

fn from_maybe_bytes(buf: Option<&mut &'a [u8]>) -> FromBytesResult<Self>

Implementors§

Source§

impl FromBytes<'_> for PT_ENUMFLAGS8_fcntl_commands

Source§

impl FromBytes<'_> for PT_ENUMFLAGS8_lseek_whence

Source§

impl FromBytes<'_> for PT_ENUMFLAGS8_rlimit_resources

Source§

impl FromBytes<'_> for PT_ENUMFLAGS8_shutdown_how

Source§

impl FromBytes<'_> for PT_ENUMFLAGS8_sockopt_levels

Source§

impl FromBytes<'_> for PT_ENUMFLAGS8_sockopt_options

Source§

impl FromBytes<'_> for PT_ENUMFLAGS16_io_uring_register_opcodes

Source§

impl FromBytes<'_> for PT_ENUMFLAGS16_ptrace_requests

Source§

impl FromBytes<'_> for PT_ENUMFLAGS32_bpf_commands

Source§

impl FromBytes<'_> for PT_ENUMFLAGS32_fsconfig_cmds

Source§

impl FromBytes<'_> for PT_ENUMFLAGS32_prctl_options

Source§

impl FromBytes<'_> for PT_ENUMFLAGS32_socket_families

Source§

impl FromBytes<'_> for IpAddr

Source§

impl FromBytes<'_> for PT_FLAGS8_quotactl_dqi_flags

Source§

impl FromBytes<'_> for PT_FLAGS8_quotactl_quota_fmts

Source§

impl FromBytes<'_> for PT_FLAGS8_quotactl_types

Source§

impl FromBytes<'_> for PT_FLAGS16_creat_flags

Source§

impl FromBytes<'_> for PT_FLAGS16_file_flags

Source§

impl FromBytes<'_> for PT_FLAGS16_futex_operations

Source§

impl FromBytes<'_> for PT_FLAGS16_quotactl_cmds

Source§

impl FromBytes<'_> for PT_FLAGS16_semctl_commands

Source§

impl FromBytes<'_> for PT_FLAGS16_semop_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_access_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_clone_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_delete_module_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_epoll_create1_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_execve_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_execveat_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_fchownat_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_file_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_finit_module_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_flock_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_io_uring_enter_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_io_uring_setup_feats

Source§

impl FromBytes<'_> for PT_FLAGS32_io_uring_setup_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_linkat_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_memfd_create_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_mlock2_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_mlockall_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_mmap_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_mount_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_newfstatat_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_openat2_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_pf_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_pidfd_open_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_prot_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_renameat2_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_semget_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_splice_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_umount_flags

Source§

impl FromBytes<'_> for PT_FLAGS32_unlinkat_flags

Source§

impl FromBytes<'_> for PT_MODE_chmod_mode

Source§

impl FromBytes<'_> for PT_MODE_mknod_mode

Source§

impl FromBytes<'_> for SystemTime

Source§

impl FromBytes<'_> for Bool

Source§

impl FromBytes<'_> for SyscallResult

Source§

impl FromBytes<'_> for Fd

Source§

impl FromBytes<'_> for FdList

Source§

impl FromBytes<'_> for Gid

Source§

impl FromBytes<'_> for IpNet

Source§

impl FromBytes<'_> for Ipv4Addr

Source§

impl FromBytes<'_> for Ipv4Net

Source§

impl FromBytes<'_> for Ipv6Addr

Source§

impl FromBytes<'_> for Ipv6Net

Source§

impl FromBytes<'_> for Pid

Source§

impl FromBytes<'_> for Port

Source§

impl FromBytes<'_> for Duration

Source§

impl FromBytes<'_> for SigSet

Source§

impl FromBytes<'_> for SigType

Source§

impl FromBytes<'_> for SockFamily

Source§

impl FromBytes<'_> for SyscallId

Source§

impl FromBytes<'_> for Uid

Source§

impl<'a> FromBytes<'a> for &'a Path

Source§

impl<'a> FromBytes<'a> for PT_DYN_bpf_dynamic_param

Source§

impl<'a> FromBytes<'a> for PT_DYN_ptrace_dynamic_param

Source§

impl<'a> FromBytes<'a> for PT_DYN_sockopt_dynamic_param<'a>

Source§

impl<'a> FromBytes<'a> for SockAddr<'a>

Source§

impl<'a> FromBytes<'a> for SockTuple<'a>

Source§

impl<'a> FromBytes<'a> for RelativePath<'a>