MTL4PipelineDataSetSerializer

Trait MTL4PipelineDataSetSerializer 

Source
pub unsafe trait MTL4PipelineDataSetSerializer: NSObjectProtocol {
    // Provided methods
    fn serializeAsArchiveAndFlushToURL_error(
        &self,
        url: &NSURL,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    fn serializeAsPipelinesScriptWithError(
        &self,
    ) -> Result<Retained<NSData>, Retained<NSError>>
       where Self: Sized + Message { ... }
}
Available on crate feature MTL4PipelineDataSetSerializer only.
Expand description

A fast-addition container for collecting data during pipeline state creation.

Pipeline data serializer instances allow you to create binary archives and serialize pipeline scripts to use with the offline Metal binary generator (metal-tt) .

You capture and retain all relevant data for all pipelines a compiler instance creates by providing an instance of this object to its MTL4CompilerDescriptor.

After capturing data, you can serialize it to a binary archive to persist its contents offline by calling serializeAsArchiveAndFlushToURL:error:. You can also serialize a pipeline script suitable for the offline binary generator (metal-tt) by calling serializeAsPipelinesScriptWithError:

  • Note: The objects MTL4PipelineDataSetSerializer contains are opaque and can’t accelerate compilation for compilers they are not attached to. Additionally, your program can’t read data out of data set serializer instances.

See also Apple’s documentation

Provided Methods§

Source

fn serializeAsArchiveAndFlushToURL_error( &self, url: &NSURL, ) -> Result<(), Retained<NSError>>
where Self: Sized + Message,

Serializes a pipeline data set to an archive.

  • Parameters:
  • url: the URL used to serialize the serializer data set as an archive to.
  • error: an optional parameter to store information in case of an error.
  • Returns: a boolean indicating whether the operation was successful.
Source

fn serializeAsPipelinesScriptWithError( &self, ) -> Result<Retained<NSData>, Retained<NSError>>
where Self: Sized + Message,

Serializes a serializer data set to a pipeline script as raw data.

  • Parameters:
  • error: an optional parameter to store information in case of an error.
  • Returns: an NSData instance containing the pipeline script.

Trait Implementations§

Source§

impl ProtocolType for dyn MTL4PipelineDataSetSerializer

Source§

const NAME: &'static str = "MTL4PipelineDataSetSerializer"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn MTL4PipelineDataSetSerializer

Implementations on Foreign Types§

Source§

impl<T> MTL4PipelineDataSetSerializer for ProtocolObject<T>

Implementors§