Skip to content

Commit f434967

Browse files
Public constructors for InputCallbackInfo, OutputCallbackInfo and StreamInstant (#945)
1 parent 51c3b43 commit f434967

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lib.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -479,19 +479,27 @@ impl StreamInstant {
479479
Self::new(s, ns)
480480
}
481481

482-
fn new(secs: i64, nanos: u32) -> Self {
482+
pub fn new(secs: i64, nanos: u32) -> Self {
483483
StreamInstant { secs, nanos }
484484
}
485485
}
486486

487487
impl InputCallbackInfo {
488+
pub fn new(timestamp: InputStreamTimestamp) -> Self {
489+
Self { timestamp }
490+
}
491+
488492
/// The timestamp associated with the call to an input stream's data callback.
489493
pub fn timestamp(&self) -> InputStreamTimestamp {
490494
self.timestamp
491495
}
492496
}
493497

494498
impl OutputCallbackInfo {
499+
pub fn new(timestamp: OutputStreamTimestamp) -> Self {
500+
Self { timestamp }
501+
}
502+
495503
/// The timestamp associated with the call to an output stream's data callback.
496504
pub fn timestamp(&self) -> OutputStreamTimestamp {
497505
self.timestamp

0 commit comments

Comments
 (0)