pub struct OwnedInfo(/* private fields */);Expand description
Owned version of Info for use with the chain API.
This is a newtype wrapper around Info<'static>, allowing it to be deserialized as owned data.
This is required for the chain API because the internal buffer may be reused between stream
iterations.
§Example
use zlink_core::varlink_service::OwnedInfo;
// OwnedInfo can be deserialized from JSON without borrowing.
let json = r#"{"vendor":"Test","product":"Product","version":"1.0","url":"https://example.com","interfaces":["org.varlink.service"]}"#;
let info: OwnedInfo = serde_json::from_str(json).unwrap();Implementations§
Source§impl OwnedInfo
impl OwnedInfo
Sourcepub fn new(
vendor: impl Into<Cow<'static, str>>,
product: impl Into<Cow<'static, str>>,
version: impl Into<Cow<'static, str>>,
url: impl Into<Cow<'static, str>>,
interfaces: impl IntoIterator<Item = impl Into<Cow<'static, str>>>,
) -> Self
pub fn new( vendor: impl Into<Cow<'static, str>>, product: impl Into<Cow<'static, str>>, version: impl Into<Cow<'static, str>>, url: impl Into<Cow<'static, str>>, interfaces: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, ) -> Self
Create a new OwnedInfo instance.
Sourcepub fn into_inner(self) -> Info<'static>
pub fn into_inner(self) -> Info<'static>
Consumes self and returns the inner Info.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OwnedInfo
impl<'de> Deserialize<'de> for OwnedInfo
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for OwnedInfo
Auto Trait Implementations§
impl Freeze for OwnedInfo
impl RefUnwindSafe for OwnedInfo
impl Send for OwnedInfo
impl Sync for OwnedInfo
impl Unpin for OwnedInfo
impl UnwindSafe for OwnedInfo
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