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

expose new_receprion_timestamp function #276

Open
milyin opened this issue Mar 10, 2024 · 0 comments
Open

expose new_receprion_timestamp function #276

milyin opened this issue Mar 10, 2024 · 0 comments
Labels
api sync Synchronize API with other bindings release Part of the next release

Comments

@milyin
Copy link
Contributor

milyin commented Mar 10, 2024

Describe the release item

Expose this function into zenoh-c

    /// Generates a reception [`Timestamp`] with id=0x01.  
    /// This operation should be called if a timestamp is required for an incoming [`zenoh::Sample`](crate::Sample)
    /// that doesn't contain any timestamp.
    // tags{rust.new_reception_timestamp, api.timestamp.create.now}
    pub fn new_reception_timestamp() -> Timestamp {
        use std::time::{SystemTime, UNIX_EPOCH};

        let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
        Timestamp::new(now.into(), TimestampId::try_from([1]).unwrap())
    }
@milyin milyin added release Part of the next release api sync Synchronize API with other bindings and removed release Part of the next release labels Mar 10, 2024
@milyin milyin added the release Part of the next release label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api sync Synchronize API with other bindings release Part of the next release
Projects
Status: Backlog
Development

No branches or pull requests

1 participant