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 { ... }
}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
MTL4PipelineDataSetSerializercontains 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§
Sourcefn serializeAsArchiveAndFlushToURL_error(
&self,
url: &NSURL,
) -> Result<(), Retained<NSError>>
fn serializeAsArchiveAndFlushToURL_error( &self, url: &NSURL, ) -> Result<(), Retained<NSError>>
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.
Sourcefn serializeAsPipelinesScriptWithError(
&self,
) -> Result<Retained<NSData>, Retained<NSError>>
fn serializeAsPipelinesScriptWithError( &self, ) -> Result<Retained<NSData>, Retained<NSError>>
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
NSDatainstance containing the pipeline script.