Skip to content

Commit

Permalink
missing necessary loan_mut's added
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Oct 15, 2024
1 parent c7e7d4d commit 8632762
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/closures/hello_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ pub extern "C" fn z_closure_hello_loan(
closure.as_loaned_c_type_ref()
}

/// Mutably norrows closure.
#[no_mangle]
pub extern "C" fn z_closure_hello_loan_mut(
closure: &mut z_owned_closure_hello_t,
) -> &mut z_loaned_closure_hello_t {
closure.as_loaned_c_type_mut()
}

/// @brief Constructs closure.
/// A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks:
///
Expand Down
8 changes: 8 additions & 0 deletions src/closures/query_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ pub extern "C" fn z_closure_query_loan(
closure.as_loaned_c_type_ref()
}

/// Mutably borrows closure.
#[no_mangle]
pub extern "C" fn z_closure_query_loan_mut(
closure: &mut z_owned_closure_query_t,
) -> &mut z_loaned_closure_query_t {
closure.as_loaned_c_type_mut()
}

/// @brief Constructs closure.
///
/// Closures are not guaranteed not to be called concurrently.
Expand Down
8 changes: 8 additions & 0 deletions src/closures/reply_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ pub extern "C" fn z_closure_reply_loan(
closure.as_loaned_c_type_ref()
}

/// Mutably borrows closure.
#[no_mangle]
pub extern "C" fn z_closure_reply_loan_mut(
closure: &mut z_owned_closure_reply_t,
) -> &mut z_loaned_closure_reply_t {
closure.as_loaned_c_type_mut()
}

/// @brief Constructs closure.
///
/// Closures are not guaranteed not to be called concurrently.
Expand Down
8 changes: 8 additions & 0 deletions src/closures/sample_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ pub extern "C" fn z_closure_sample_loan(
closure.as_loaned_c_type_ref()
}

/// Mutably borrows closure.
#[no_mangle]
pub extern "C" fn z_closure_sample_loan_mut(
closure: &mut z_owned_closure_sample_t,
) -> &mut z_loaned_closure_sample_t {
closure.as_loaned_c_type_mut()
}

/// @brief Constructs closure.
///
/// Closures are not guaranteed not to be called concurrently.
Expand Down
8 changes: 8 additions & 0 deletions src/closures/zenohid_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ pub extern "C" fn z_closure_zid_loan(closure: &z_owned_closure_zid_t) -> &z_loan
closure.as_loaned_c_type_ref()
}

/// @brief Mutably borrows closure.
#[no_mangle]
pub extern "C" fn z_closure_zid_loan_mut(
closure: &z_owned_closure_zid_t,
) -> &z_loaned_closure_zid_t {
closure.as_loaned_c_type_ref()
}

/// @brief Constructs closure.
///
/// Closures are not guaranteed not to be called concurrently.
Expand Down

0 comments on commit 8632762

Please sign in to comment.