atc_router::ffi::router

Function router_remove_matcher

Source
#[no_mangle]
pub unsafe extern "C" fn router_remove_matcher(
    router: &mut Router<'_>,
    priority: usize,
    uuid: *const i8,
) -> bool
Expand description

Remove a matcher from the router.

§Arguments

  • router: a pointer to the Router object returned by router_new.
  • priority: the priority of the matcher to be removed.
  • uuid: the C-style string representing the UUID of the matcher to be removed.

§Returns

Returns true if the matcher was removed successfully, otherwise false, such as when the matcher with the specified UUID doesn’t exist or the priority doesn’t match the UUID.

§Panics

This function will panic when uuid doesn’t point to a ASCII sequence

§Safety

Violating any of the following constraints will result in undefined behavior:

  • router must be a valid pointer returned by router_new.
  • uuid must be a valid pointer to a C-style string, must be properly aligned, and must not have ‘\0’ in the middle.