Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper for class name #255

Merged
merged 2 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/builders/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ impl ModuleBuilder {
/// This function can be useful if you need to do any final cleanup at the
/// very end of a request, after all other resources have been released. For
/// example, if your extension creates any persistent resources that last
/// beyond a single request, you could use this function to clean those up. # Arguments
/// beyond a single request, you could use this function to clean those up.
/// # Arguments
///
/// * `func` - The function to be called when shutdown is requested.
pub fn post_deactivate_function(mut self, func: extern "C" fn() -> i32) -> Self {
Expand Down
4 changes: 4 additions & 0 deletions src/zend/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ impl ClassEntry {
Self::try_find(name.as_str().ok()?)
}
}

pub fn name(&self) -> Option<&str> {
unsafe { self.name.as_ref().and_then(|s| s.as_str().ok()) }
}
}

impl PartialEq for ClassEntry {
Expand Down