pub trait GroupOperations {
type Child: 'static;
const USE_VTABLE_ATTR: ();
const HAS_MAKE_GROUP: bool = false;
const HAS_DROP_ITEM: bool = false;
// Required method
fn make_group(
&self,
name: &CStr,
) -> Result<impl PinInit<Group<Self::Child>, Error>>;
// Provided method
fn drop_item(&self, _child: ArcBorrow<'_, Group<Self::Child>>) { ... }
}
Expand description
Required Associated Constants§
Sourceconst USE_VTABLE_ATTR: ()
const USE_VTABLE_ATTR: ()
A marker to prevent implementors from forgetting to use #[vtable]
attribute when implementing this trait.
Provided Associated Constants§
Sourceconst HAS_MAKE_GROUP: bool = false
const HAS_MAKE_GROUP: bool = false
Indicates if the make_group
method is overridden by the implementor.
Sourceconst HAS_DROP_ITEM: bool = false
const HAS_DROP_ITEM: bool = false
Indicates if the drop_item
method is overridden by the implementor.
Required Associated Types§
Required Methods§
Sourcefn make_group(
&self,
name: &CStr,
) -> Result<impl PinInit<Group<Self::Child>, Error>>
fn make_group( &self, name: &CStr, ) -> Result<impl PinInit<Group<Self::Child>, Error>>
Creates a new subgroup.
The kernel will call this method in response to mkdir(2)
in the
directory representing this
.
To accept the request to create a group, implementations should
return an initializer of a Group<Self::Child>
. To prevent creation,
return a suitable error.
Provided Methods§
Sourcefn drop_item(&self, _child: ArcBorrow<'_, Group<Self::Child>>)
fn drop_item(&self, _child: ArcBorrow<'_, Group<Self::Child>>)
Prepares the group for removal from configfs.
The kernel will call this method before the directory representing _child
is removed from
configfs.
Implementations can use this method to do house keeping before configfs drops its
reference to Child
.
NOTE: “drop” in the name of this function is not related to the Rust drop term. Rather, the name is inherited from the callback name in the underlying C code.
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.