pub trait Rc {
// Required method
fn as_base(&self) -> &cef_base_ref_counted_t;
// Provided methods
unsafe fn add_ref(&self) { ... }
unsafe fn release(&self) -> bool { ... }
fn has_one_ref(&self) -> bool { ... }
fn has_at_least_one_ref(&self) -> bool { ... }
}Expand description
Reference counted trait for types has cef_base_ref_counted_t.
Required Methods§
Sourcefn as_base(&self) -> &cef_base_ref_counted_t
fn as_base(&self) -> &cef_base_ref_counted_t
Get the reference of cef_base_ref_counted_t.
Provided Methods§
Sourceunsafe fn add_ref(&self)
unsafe fn add_ref(&self)
Increase the reference count by 1.
§Safety
Calling this method when you need to manually handle the reference count. Otherwise, these methods shouldn’t be called externally in most cases.
Sourceunsafe fn release(&self) -> bool
unsafe fn release(&self) -> bool
Decrease reference count by 1 and release the value if the count meets 0.
Reuturn True if it is released.
§Safety
Calling this method when you need to manually handle the reference count. Otherwise, these methods shouldn’t be called externally in most cases.
Sourcefn has_one_ref(&self) -> bool
fn has_one_ref(&self) -> bool
True if the reference count is exactly 1.
Sourcefn has_at_least_one_ref(&self) -> bool
fn has_at_least_one_ref(&self) -> bool
True if the reference count is larger than 0.