Skip to content

Commit 29586b3

Browse files
committed
only provide reference to edge weight
1 parent e16b30d commit 29586b3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

dasp_graph/src/node/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub trait Node<W = ()> {
9393
pub struct Input<W = ()> {
9494
buffers_ptr: *const Buffer,
9595
buffers_len: usize,
96-
pub edge_weight: W,
96+
edge_weight: W,
9797
}
9898

9999
impl<W> Input<W> {
@@ -115,6 +115,11 @@ impl<W> Input<W> {
115115
// alive.
116116
unsafe { std::slice::from_raw_parts(self.buffers_ptr, self.buffers_len) }
117117
}
118+
119+
/// A reference to the input's edge weight.
120+
pub fn edge_weight(&self) -> &W {
121+
&self.edge_weight
122+
}
118123
}
119124

120125
// Inputs can only be created by the `dasp_graph::process` implementation and only ever live as

0 commit comments

Comments
 (0)