5 trait Structure
<E
>: Sized
where E
: Encoding
{
6 type RefTarget
: ?Sized
;
8 unsafe fn borrow_from_ffi_ptr
<'a
>(ptr
: Self::FfiPtr
) -> Option
<&'a
Self::RefTarget
>;
13 impl<E
> Structure
<E
> for Slice
where E
: Encoding
{
14 type RefTarget
= [E
::Unit
];
15 type FfiPtr
= (*const E
::FfiUnit
, usize);
16 unsafe fn borrow_from_ffi_ptr
<'a
>(_ptr
: Self::FfiPtr
) -> Option
<&'a
Self::RefTarget
> {
30 impl Encoding
for Utf16
{
31 type Unit
= Utf16Unit
;
35 struct Utf16Unit(pub u16);
37 impl Unit
for Utf16Unit {}
39 type SUtf16Str
= SeStr
<Slice
, Utf16
>;
41 struct SeStr
<S
, E
> where S
: Structure
<E
>, E
: Encoding
{
45 impl<S
, E
> SeStr
<S
, E
> where S
: Structure
<E
>, E
: Encoding
{
46 pub unsafe fn from_ptr
<'a
>(_ptr
: S
::FfiPtr
) -> Option
<&'a
Self> {
52 const TEXT_U16
: &'
static [u16] = &[];
53 let _
= unsafe { SUtf16Str::from_ptr((TEXT_U16.as_ptr(), TEXT_U16.len())).unwrap() }
;