Skip to main content

oxilean_codegen/cranelift_backend/
memflags_traits.rs

1//! # MemFlags - Trait Implementations
2//!
3//! This module contains trait implementations for `MemFlags`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Default`
8//! - `Display`
9//!
10//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
11
12use super::types::MemFlags;
13use std::fmt;
14
15impl Default for MemFlags {
16    fn default() -> Self {
17        Self::new()
18    }
19}
20
21impl fmt::Display for MemFlags {
22    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23        let mut parts = vec![];
24        if self.aligned {
25            parts.push("aligned");
26        }
27        if self.notrap {
28            parts.push("notrap");
29        }
30        if self.readonly {
31            parts.push("readonly");
32        }
33        write!(f, "{}", parts.join(" "))
34    }
35}