pub struct GraphMetadata {
pub name: String,
pub version: String,
pub creator: String,
pub target: Option<String>,
pub optimization_level: OptimizationLevel,
pub custom: HashMap<String, String>,
}Expand description
Graph metadata containing additional information about the computation graph
Fields§
§name: StringGraph name
version: StringGraph version
creator: StringCreator information
target: Option<String>Compilation target
optimization_level: OptimizationLevelOptimization level
custom: HashMap<String, String>Additional custom metadata
Implementations§
Source§impl GraphMetadata
impl GraphMetadata
Sourcepub fn with_version(self, version: String) -> Self
pub fn with_version(self, version: String) -> Self
Set version
Sourcepub fn with_creator(self, creator: String) -> Self
pub fn with_creator(self, creator: String) -> Self
Set creator
Sourcepub fn with_target(self, target: String) -> Self
pub fn with_target(self, target: String) -> Self
Set target
Sourcepub fn with_optimization_level(self, level: OptimizationLevel) -> Self
pub fn with_optimization_level(self, level: OptimizationLevel) -> Self
Set optimization level
Sourcepub fn with_custom(self, key: String, value: String) -> Self
pub fn with_custom(self, key: String, value: String) -> Self
Add custom metadata
Sourcepub fn get_custom(&self, key: &str) -> Option<&String>
pub fn get_custom(&self, key: &str) -> Option<&String>
Get custom metadata value
Trait Implementations§
Source§impl Clone for GraphMetadata
impl Clone for GraphMetadata
Source§fn clone(&self) -> GraphMetadata
fn clone(&self) -> GraphMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphMetadata
impl Debug for GraphMetadata
Source§impl Default for GraphMetadata
impl Default for GraphMetadata
Source§fn default() -> GraphMetadata
fn default() -> GraphMetadata
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GraphMetadata
impl RefUnwindSafe for GraphMetadata
impl Send for GraphMetadata
impl Sync for GraphMetadata
impl Unpin for GraphMetadata
impl UnsafeUnpin for GraphMetadata
impl UnwindSafe for GraphMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more