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 default empty state for Sample structure #1568

Open
milyin opened this issue Oct 28, 2024 · 0 comments
Open

add default empty state for Sample structure #1568

milyin opened this issue Oct 28, 2024 · 0 comments
Labels
release Part of the next release

Comments

@milyin
Copy link
Contributor

milyin commented Oct 28, 2024

Describe the release item

The Rust API provides two variants of mutable access to Sample in reply: result_mut and into_result:

pub struct Reply {
    pub(crate) result: Result<Sample, ReplyError>,
...
}
impl Reply {
    pub fn result_mut(&mut self) -> Result<&mut Sample, &mut ReplyError> {...}
    pub fn into_result(self) -> Result<Sample, ReplyError> {...}
}

In zenoh-c API the only way to take ownership on Sample is through &mut Sample, but it's impossible unless we can replace sample to valid empty one.

E.g. this update eclipse-zenoh/zenoh-c#718 is actually blocked because we can't safely provide take operation from mutable sample reference.

@milyin milyin added the release Part of the next release label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Part of the next release
Projects
Status: No status
Development

No branches or pull requests

1 participant