Trait kernel::configfs::HasGroup

source ·
pub unsafe trait HasGroup<Data> {
    // Required methods
    unsafe fn group(this: *const Self) -> *const config_group;
    unsafe fn container_of(group: *const config_group) -> *const Self;
}
Expand description

Trait that allows offset calculations for structs that embed a bindings::config_group.

Users of the configfs API should not need to implement this trait.

§Safety

  • Implementers of this trait must embed a bindings::config_group.
  • Methods must be implemented according to method documentation.

Required Methods§

source

unsafe fn group(this: *const Self) -> *const config_group

Return the address of the bindings::config_group embedded in Self.

§Safety
  • this must be a valid allocation of at least the size of Self.
source

unsafe fn container_of(group: *const config_group) -> *const Self

Return the address of the Self that group is embedded in.

§Safety
  • group must point to the bindings::config_group that is embedded in Self.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Data> HasGroup<Data> for Group<Data>

source§

impl<Data> HasGroup<Data> for Subsystem<Data>