Skip to content

Commit 52313d4

Browse files
committed
Added get method.
1 parent 790b8cc commit 52313d4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/js/counters.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@ impl TryFrom<async_nats::jetstream::message::StreamMessage> for CounterEntry {
284284
}
285285
}
286286

287+
#[pyo3::pymethods]
288+
impl CounterEntry {
289+
pub fn __repr__(&self) -> String {
290+
format!(
291+
"CounterEntry<subject={:?}, value={}, increment={}>",
292+
self.subject,
293+
self.value,
294+
self.increment
295+
.as_ref()
296+
.map_or_else(|| String::from("None"), ToString::to_string)
297+
)
298+
}
299+
}
300+
287301
#[pyo3::pyclass]
288302
#[allow(dead_code)]
289303
pub struct Counters {

0 commit comments

Comments
 (0)