-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Labels
tracked-in-jiraTicket filed in Mongo's Jira systemTicket filed in Mongo's Jira system
Description
I have a struct like this:
#[derive(Deserialize)]
struct Example<'a> {
#[serde(borrow)]
field: Option<Cow<'a, str>>,
#[serde(borrow, default)]
other_field: Vec<Cow<'a, str>>,
}I'd like to use it with this crate, but the DeserializeOwned bound gets in the way.
I think the issue is that deserialization goes through Document, which in turn requires ownership of strings etc. inside it. Is that correct, and if so could that be mitigated by having a bson::borrow::Bson which points into a backing &'a [u8]?
Metadata
Metadata
Assignees
Labels
tracked-in-jiraTicket filed in Mongo's Jira systemTicket filed in Mongo's Jira system