pub struct LibraryRef(/* private fields */);Expand description
A borrowed reference to a Library.
Implementations§
Source§impl LibraryRef
impl LibraryRef
pub fn device(&self) -> &DeviceRef
pub fn label(&self) -> &str
pub fn set_label(&self, label: &str)
Sourcepub fn get_function(
&self,
name: &str,
constants: Option<FunctionConstantValues>,
) -> Result<Function, String>
pub fn get_function( &self, name: &str, constants: Option<FunctionConstantValues>, ) -> Result<Function, String>
Retrieve a function from the library.
Although this method is named get_function, the underlying Metal
method is named newFunctionWithName, and it returns a retained object
that has not been added to the autorelease pool.
See https://github.com/gfx-rs/metal-rs/issues/128.
pub fn function_names(&self) -> Vec<String>
Sourcepub fn library_type(&self) -> MTLLibraryType
pub fn library_type(&self) -> MTLLibraryType
Only available on (macos(11.0), ios(14.0))
Sourcepub fn install_name(&self) -> Option<&str>
pub fn install_name(&self) -> Option<&str>
Only available on (macos(11.0), ios(14.0))
Sourcepub fn new_function_with_descriptor(
&self,
descriptor: &FunctionDescriptorRef,
) -> Result<Function, String>
pub fn new_function_with_descriptor( &self, descriptor: &FunctionDescriptorRef, ) -> Result<Function, String>
Only available on (macos(11.0), ios(14.0))
Sourcepub fn new_intersection_function_with_descriptor(
&self,
descriptor: &IntersectionFunctionDescriptorRef,
) -> Result<Function, String>
pub fn new_intersection_function_with_descriptor( &self, descriptor: &IntersectionFunctionDescriptorRef, ) -> Result<Function, String>
Only available on (macos(11.0), ios(14.0))
Trait Implementations§
Source§impl AsMut<LibraryRef> for Library
impl AsMut<LibraryRef> for Library
Source§fn as_mut(&mut self) -> &mut LibraryRef
fn as_mut(&mut self) -> &mut LibraryRef
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<LibraryRef> for Library
impl AsRef<LibraryRef> for Library
Source§fn as_ref(&self) -> &LibraryRef
fn as_ref(&self) -> &LibraryRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<LibraryRef> for Library
impl Borrow<LibraryRef> for Library
Source§fn borrow(&self) -> &LibraryRef
fn borrow(&self) -> &LibraryRef
Immutably borrows from an owned value. Read more
Source§impl BorrowMut<LibraryRef> for Library
impl BorrowMut<LibraryRef> for Library
Source§fn borrow_mut(&mut self) -> &mut LibraryRef
fn borrow_mut(&mut self) -> &mut LibraryRef
Mutably borrows from an owned value. Read more
Source§impl Debug for LibraryRef
impl Debug for LibraryRef
Source§impl ForeignTypeRef for LibraryRef
impl ForeignTypeRef for LibraryRef
Source§type CType = MTLLibrary
type CType = MTLLibrary
The raw C type.
Source§unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
Constructs a shared instance of this type from its raw type. Read more
Source§impl Message for LibraryRef
impl Message for LibraryRef
Source§unsafe fn send_message<A, R>(
&self,
sel: Sel,
args: A,
) -> Result<R, MessageError>
unsafe fn send_message<A, R>( &self, sel: Sel, args: A, ) -> Result<R, MessageError>
Sends a message to self with the given selector and arguments. Read more
Source§fn verify_message<A, R>(&self, sel: Sel) -> Result<(), MessageError>
fn verify_message<A, R>(&self, sel: Sel) -> Result<(), MessageError>
Verifies that the argument and return types match the encoding of the
method for the given selector. Read more