oxilean_codegen/futhark_backend/futharkstreamred_traits.rs
1//! # FutharkStreamRed - Trait Implementations
2//!
3//! This module contains trait implementations for `FutharkStreamRed`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::{FutharkStreamKind, FutharkStreamRed};
12use std::fmt;
13
14impl std::fmt::Display for FutharkStreamRed {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 let kw = match self.kind {
17 FutharkStreamKind::Seq => "stream_red_seq",
18 FutharkStreamKind::Par => "stream_red",
19 };
20 write!(
21 f,
22 "{} ({}) {} ({}) {}",
23 kw, self.op, self.neutral, self.func, self.array
24 )
25 }
26}