Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/make public constructors for InputCallbackInfo, OutputCallbackInfo and StreamInstant #945

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,19 +479,27 @@ impl StreamInstant {
Self::new(s, ns)
}

fn new(secs: i64, nanos: u32) -> Self {
pub fn new(secs: i64, nanos: u32) -> Self {
StreamInstant { secs, nanos }
}
}

impl InputCallbackInfo {
pub fn new(timestamp: InputStreamTimestamp) -> Self {
Self { timestamp }
}

/// The timestamp associated with the call to an input stream's data callback.
pub fn timestamp(&self) -> InputStreamTimestamp {
self.timestamp
}
}

impl OutputCallbackInfo {
pub fn new(timestamp: OutputStreamTimestamp) -> Self {
Self { timestamp }
}

/// The timestamp associated with the call to an output stream's data callback.
pub fn timestamp(&self) -> OutputStreamTimestamp {
self.timestamp
Expand Down
Loading