[−][src]Struct lv2rs_core::Feature
Feature.
Features allow hosts to make additional functionality available to plugins
without requiring modification to the LV2 API. Extensions may define new
features and specify the uri
and data
to be used if necessary.
Some features, such as lv2:isLive
, do not require the host to pass data.
Methods
impl Feature
[src]
pub fn uri(&self) -> Option<&CStr>
[src]
Try to get the URI of the feature.
None if the URI is pointing to null.
pub unsafe fn data<T>(&mut self) -> Option<&mut T>
[src]
Try to get a pointer to the feature's data.
None if the internal feature is pointing to null.
This function is unsafe, since we don't know if the data really has type T
. It's your
responsibility to ensure that the data has the correct type.
pub fn get_feature_raw(
features: &FeaturesList,
uri: &CStr
) -> Option<*mut c_void>
[src]
features: &FeaturesList,
uri: &CStr
) -> Option<*mut c_void>
Try to find a feature in the features list by it's URI.
This function is safe, since the data pointer is not touched at all and therefore, no UB can be triggered.
pub unsafe fn get_feature<T>(
features: &FeaturesList,
uri: &CStr
) -> Option<&'static mut T>
[src]
features: &FeaturesList,
uri: &CStr
) -> Option<&'static mut T>
Try to find a feature in the features list and cast the data.
This function in unsafe, since it can not check if the data is of type T. It is your responsibility to ensure the soundness of the cast.
Auto Trait Implementations
impl !Send for Feature
impl Unpin for Feature
impl !Sync for Feature
impl UnwindSafe for Feature
impl RefUnwindSafe for Feature
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,