pub struct CommandRegistration(/* private fields */);Expand description
Registration for CLI command
This is typically created automatically using the crate::vlib_cli_command macro.
Implementations§
Source§impl CommandRegistration
impl CommandRegistration
Sourcepub const fn new(command: vlib_cli_command_t) -> Self
pub const fn new(command: vlib_cli_command_t) -> Self
Creates a new CommandRegistration from the given registration data
Sourcepub unsafe fn register(&'static self)
pub unsafe fn register(&'static self)
Registers the CLI command with VPP
§Safety
- Must be called only once for this node registration.
- Must be called from a constructor function that is invoked before VPP initialises.
- The following pointers in the registration data must be valid:
path(must be a valid, nul-terminated string)short_help(must be a valid, nul-terminated string or null)long_help(must be a valid, nul-terminated string or null)
- Other pointers must either point to a valid object of the appropriate type or be null.
Sourcepub unsafe fn unregister(&self)
pub unsafe fn unregister(&self)
Unregisters the CLI command from VPP
§Safety
- Must be called only once for this registration.
- Must be called from a destructor function that is invoked after VPP uninitialises.
- The CLI command must have been previously registered with VPP using
Self::register.
Trait Implementations§
impl Send for CommandRegistration
impl Sync for CommandRegistration
Auto Trait Implementations§
impl !Freeze for CommandRegistration
impl !RefUnwindSafe for CommandRegistration
impl Unpin for CommandRegistration
impl UnsafeUnpin for CommandRegistration
impl UnwindSafe for CommandRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more