pub fn to_unknown(&self) -> crate::Result<Cow<'_, Unknown>> {
        match self {
            Content::Unknown(unknown) => Ok(Cow::Borrowed(unknown)),
            content => {
                let version = Version::default();
                let mut data = Vec::new();
                crate::stream::frame::content::encode(&mut data, content, version, Encoding::UTF8)?;
                Ok(Cow::Owned(Unknown { data, version }))
            }
        }
    }
/// Returns the `Unknown` variant or an ad-hoc encoding of any other variant.
///
/// See the compatibility note on the docs of `Content` for the reason of why this function
/// exists.
Returns the `Unknown` variant or an ad-hoc encoding of any other variant.
See the compatibility note on the docs of `Content` for the reason of why this function
exists.
Returns the ` Unknown ` variant or an ad - hoc encoding of any other variant . See the compatibility note on the docs of ` Content ` for the reason of why this function exists .
pub fn to_unknown(&self) -> crate::Result<Cow<'_, Unknown>> {
        match self {
            Content::Unknown(unknown) => Ok(Cow::Borrowed(unknown)),
            content => {
                let version = Version::default();
                let mut data = Vec::new();
                crate::stream::frame::content::encode(&mut data, content, version, Encoding::UTF8)?;
                Ok(Cow::Owned(Unknown { data, version }))
            }
        }
    }
pub fn to_unknown ( & self ) -> crate :: Result < Cow < ' _ , Unknown > > { match self { Content :: Unknown ( unknown ) => Ok ( Cow :: Borrowed ( unknown ) ) , content => { let version = Version :: default ( ) ; let mut data = Vec :: new ( ) ; crate :: stream :: frame :: content :: encode ( & mut data , content , version , Encoding :: UTF8 ) ? ; Ok ( Cow :: Owned ( Unknown { data , version } ) ) } } }
Returns the `Unknown` variant or an ad-hoc encoding of any other variant.
Returns the ` Unknown ` variant or an ad - hoc encoding of any other variant .
&self
&self