pub fn as_raw_bson_ref(&self) -> RawBsonRef<'_> {
        match self {
            RawBson::Double(d) => RawBsonRef::Double(*d),
            RawBson::String(s) => RawBsonRef::String(s.as_str()),
            RawBson::Array(a) => RawBsonRef::Array(a),
            RawBson::Document(d) => RawBsonRef::Document(d),
            RawBson::Boolean(b) => RawBsonRef::Boolean(*b),
            RawBson::Null => RawBsonRef::Null,
            RawBson::RegularExpression(re) => RawBsonRef::RegularExpression(RawRegexRef {
                options: re.options.as_str(),
                pattern: re.pattern.as_str(),
            }),
            RawBson::JavaScriptCode(c) => RawBsonRef::JavaScriptCode(c.as_str()),
            RawBson::JavaScriptCodeWithScope(code_w_scope) => {
                RawBsonRef::JavaScriptCodeWithScope(RawJavaScriptCodeWithScopeRef {
                    code: code_w_scope.code.as_str(),
                    scope: code_w_scope.scope.as_ref(),
                })
            }
            RawBson::Int32(i) => RawBsonRef::Int32(*i),
            RawBson::Int64(i) => RawBsonRef::Int64(*i),
            RawBson::Timestamp(ts) => RawBsonRef::Timestamp(*ts),
            RawBson::Binary(b) => RawBsonRef::Binary(RawBinaryRef {
                bytes: b.bytes.as_slice(),
                subtype: b.subtype,
            }),
            RawBson::ObjectId(oid) => RawBsonRef::ObjectId(*oid),
            RawBson::DateTime(dt) => RawBsonRef::DateTime(*dt),
            RawBson::Symbol(s) => RawBsonRef::Symbol(s.as_str()),
            RawBson::Decimal128(d) => RawBsonRef::Decimal128(*d),
            RawBson::Undefined => RawBsonRef::Undefined,
            RawBson::MaxKey => RawBsonRef::MaxKey,
            RawBson::MinKey => RawBsonRef::MinKey,
            RawBson::DbPointer(dbp) => RawBsonRef::DbPointer(RawDbPointerRef {
                namespace: dbp.namespace.as_str(),
                id: dbp.id,
            }),
        }
    }
/// Gets a [`RawBsonRef`] value referencing this owned raw BSON value.
Gets a [`RawBsonRef`] value referencing this owned raw BSON value.
Gets a [ ` RawBsonRef ` ] value referencing this owned raw BSON value .
pub fn as_raw_bson_ref(&self) -> RawBsonRef<'_> {
        match self {
            RawBson::Double(d) => RawBsonRef::Double(*d),
            RawBson::String(s) => RawBsonRef::String(s.as_str()),
            RawBson::Array(a) => RawBsonRef::Array(a),
            RawBson::Document(d) => RawBsonRef::Document(d),
            RawBson::Boolean(b) => RawBsonRef::Boolean(*b),
            RawBson::Null => RawBsonRef::Null,
            RawBson::RegularExpression(re) => RawBsonRef::RegularExpression(RawRegexRef {
                options: re.options.as_str(),
                pattern: re.pattern.as_str(),
            }),
            RawBson::JavaScriptCode(c) => RawBsonRef::JavaScriptCode(c.as_str()),
            RawBson::JavaScriptCodeWithScope(code_w_scope) => {
                RawBsonRef::JavaScriptCodeWithScope(RawJavaScriptCodeWithScopeRef {
                    code: code_w_scope.code.as_str(),
                    scope: code_w_scope.scope.as_ref(),
                })
            }
            RawBson::Int32(i) => RawBsonRef::Int32(*i),
            RawBson::Int64(i) => RawBsonRef::Int64(*i),
            RawBson::Timestamp(ts) => RawBsonRef::Timestamp(*ts),
            RawBson::Binary(b) => RawBsonRef::Binary(RawBinaryRef {
                bytes: b.bytes.as_slice(),
                subtype: b.subtype,
            }),
            RawBson::ObjectId(oid) => RawBsonRef::ObjectId(*oid),
            RawBson::DateTime(dt) => RawBsonRef::DateTime(*dt),
            RawBson::Symbol(s) => RawBsonRef::Symbol(s.as_str()),
            RawBson::Decimal128(d) => RawBsonRef::Decimal128(*d),
            RawBson::Undefined => RawBsonRef::Undefined,
            RawBson::MaxKey => RawBsonRef::MaxKey,
            RawBson::MinKey => RawBsonRef::MinKey,
            RawBson::DbPointer(dbp) => RawBsonRef::DbPointer(RawDbPointerRef {
                namespace: dbp.namespace.as_str(),
                id: dbp.id,
            }),
        }
    }
pub fn as_raw_bson_ref ( & self ) -> RawBsonRef < ' _ > { match self { RawBson :: Double ( d ) => RawBsonRef :: Double ( * d ) , RawBson :: String ( s ) => RawBsonRef :: String ( s . as_str ( ) ) , RawBson :: Array ( a ) => RawBsonRef :: Array ( a ) , RawBson :: Document ( d ) => RawBsonRef :: Document ( d ) , RawBson :: Boolean ( b ) => RawBsonRef :: Boolean ( * b ) , RawBson :: Null => RawBsonRef :: Null , RawBson :: RegularExpression ( re ) => RawBsonRef :: RegularExpression ( RawRegexRef { options : re . options . as_str ( ) , pattern : re . pattern . as_str ( ) , } ) , RawBson :: JavaScriptCode ( c ) => RawBsonRef :: JavaScriptCode ( c . as_str ( ) ) , RawBson :: JavaScriptCodeWithScope ( code_w_scope ) => { RawBsonRef :: JavaScriptCodeWithScope ( RawJavaScriptCodeWithScopeRef { code : code_w_scope . code . as_str ( ) , scope : code_w_scope . scope . as_ref ( ) , } ) } RawBson :: Int32 ( i ) => RawBsonRef :: Int32 ( * i ) , RawBson :: Int64 ( i ) => RawBsonRef :: Int64 ( * i ) , RawBson :: Timestamp ( ts ) => RawBsonRef :: Timestamp ( * ts ) , RawBson :: Binary ( b ) => RawBsonRef :: Binary ( RawBinaryRef { bytes : b . bytes . as_slice ( ) , subtype : b . subtype , } ) , RawBson :: ObjectId ( oid ) => RawBsonRef :: ObjectId ( * oid ) , RawBson :: DateTime ( dt ) => RawBsonRef :: DateTime ( * dt ) , RawBson :: Symbol ( s ) => RawBsonRef :: Symbol ( s . as_str ( ) ) , RawBson :: Decimal128 ( d ) => RawBsonRef :: Decimal128 ( * d ) , RawBson :: Undefined => RawBsonRef :: Undefined , RawBson :: MaxKey => RawBsonRef :: MaxKey , RawBson :: MinKey => RawBsonRef :: MinKey , RawBson :: DbPointer ( dbp ) => RawBsonRef :: DbPointer ( RawDbPointerRef { namespace : dbp . namespace . as_str ( ) , id : dbp . id , } ) , } }
Gets a [`RawBsonRef`] value referencing this owned raw BSON value.
Gets a [ ` RawBsonRef ` ] value referencing this owned raw BSON value .
&self
&self