Trait kernel::configfs::AttributeOperations
source · pub trait AttributeOperations<const ID: u64 = 0> {
type Data;
const USE_VTABLE_ATTR: ();
const HAS_SHOW: bool = false;
const HAS_STORE: bool = false;
// Required method
fn show(data: &Self::Data, page: &mut [u8; 4096]) -> Result<usize>;
// Provided method
fn store(_data: &Self::Data, _page: &[u8]) -> Result { ... }
}
Expand description
Operations supported by an attribute.
Implement this trait on type and pass that type as generic parameter when
creating an Attribute
. The type carrying the implementation serve no
purpose other than specifying the attribute operations.
This trait must be implemented on the Data
type of for types that
implement HasGroup<Data>
. The trait must be implemented once for each
attribute of the group. The constant type parameter ID
maps the
implementation to a specific Attribute
. ID
must be passed when declaring
attributes via the kernel::configfs_attrs
macro, to tie
AttributeOperations
implementations to concrete named attributes.
Required Associated Types§
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§
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.