pub unsafe fn take_from_raw(raw: *mut hb::hb_buffer_t) -> Option<TypedBuffer> {
        let generic_buf: Owned<GenericBuffer> = Owned::from_raw(raw);
        let content_type = generic_buf.content_type();
        match content_type {
            hb::HB_BUFFER_CONTENT_TYPE_UNICODE => {
                Some(TypedBuffer::Unicode(UnicodeBuffer(generic_buf)))
            }
            hb::HB_BUFFER_CONTENT_TYPE_GLYPHS => {
                Some(TypedBuffer::Glyphs(GlyphBuffer(generic_buf)))
            }
            _ => None,
        }
    }
/// Takes ownership of the raw `hb_buffer_t` object and converts it to are
/// `TypedBuffer`. If no safe conversion is possible returns `None`.
Takes ownership of the raw `hb_buffer_t` object and converts it to are
`TypedBuffer`. If no safe conversion is possible returns `None`.
Takes ownership of the raw ` hb_buffer_t ` object and converts it to are ` TypedBuffer ` . If no safe conversion is possible returns ` None ` .
pub unsafe fn take_from_raw(raw: *mut hb::hb_buffer_t) -> Option<TypedBuffer> {
        let generic_buf: Owned<GenericBuffer> = Owned::from_raw(raw);
        let content_type = generic_buf.content_type();
        match content_type {
            hb::HB_BUFFER_CONTENT_TYPE_UNICODE => {
                Some(TypedBuffer::Unicode(UnicodeBuffer(generic_buf)))
            }
            hb::HB_BUFFER_CONTENT_TYPE_GLYPHS => {
                Some(TypedBuffer::Glyphs(GlyphBuffer(generic_buf)))
            }
            _ => None,
        }
    }
pub unsafe fn take_from_raw ( raw : * mut hb :: hb_buffer_t ) -> Option < TypedBuffer > { let generic_buf : Owned < GenericBuffer > = Owned :: from_raw ( raw ) ; let content_type = generic_buf . content_type ( ) ; match content_type { hb :: HB_BUFFER_CONTENT_TYPE_UNICODE => { Some ( TypedBuffer :: Unicode ( UnicodeBuffer ( generic_buf ) ) ) } hb :: HB_BUFFER_CONTENT_TYPE_GLYPHS => { Some ( TypedBuffer :: Glyphs ( GlyphBuffer ( generic_buf ) ) ) } _ => None , } }
Takes ownership of the raw `hb_buffer_t` object and converts it to are
`TypedBuffer`.
Takes ownership of the raw ` hb_buffer_t ` object and converts it to are ` TypedBuffer ` .
raw
*mut hb::hb_buffer_t
raw
*mut hb::hb_buffer_t