pub struct BorrowedCow;Expand description
A proxy type that enables borrowing from the document when parsing Cow<'doc, T>.
Unlike the default Cow<'static, T> implementation which always returns Cow::Owned,
this proxy returns Cow::Borrowed by parsing &'doc T directly from the document.
§Example
ⓘ
use eure_macros::FromEure;
use std::borrow::Cow;
#[derive(FromEure)]
struct Data<'doc> {
#[eure(via = "eure_document::proxy::BorrowedCow")]
name: Cow<'doc, str>,
}Trait Implementations§
Source§impl<'doc, T> FromEure<'doc, Cow<'doc, T>> for BorrowedCow
impl<'doc, T> FromEure<'doc, Cow<'doc, T>> for BorrowedCow
Auto Trait Implementations§
impl Freeze for BorrowedCow
impl RefUnwindSafe for BorrowedCow
impl Send for BorrowedCow
impl Sync for BorrowedCow
impl Unpin for BorrowedCow
impl UnwindSafe for BorrowedCow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more