mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
style: Remove HasSimpleFFI
It's completely unsused and we don't want to use it any time soon, see bug 1831539 and related. Differential Revision: https://phabricator.services.mozilla.com/D177497
This commit is contained in:
parent
19e037d921
commit
42cbb9d3cf
1 changed files with 0 additions and 37 deletions
|
@ -19,43 +19,6 @@ pub unsafe trait HasFFI: Sized + 'static {
|
||||||
type FFIType: Sized;
|
type FFIType: Sized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Indicates that a given Servo type has the same layout as the corresponding
|
|
||||||
/// `HasFFI::FFIType` type.
|
|
||||||
pub unsafe trait HasSimpleFFI: HasFFI {
|
|
||||||
#[inline]
|
|
||||||
/// Given a Servo-side reference, converts it to an FFI-safe reference which
|
|
||||||
/// can be passed to Gecko.
|
|
||||||
///
|
|
||||||
/// &ServoType -> &GeckoType
|
|
||||||
fn as_ffi(&self) -> &Self::FFIType {
|
|
||||||
unsafe { transmute(self) }
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
/// Given a Servo-side mutable reference, converts it to an FFI-safe mutable
|
|
||||||
/// reference which can be passed to Gecko.
|
|
||||||
///
|
|
||||||
/// &mut ServoType -> &mut GeckoType
|
|
||||||
fn as_ffi_mut(&mut self) -> &mut Self::FFIType {
|
|
||||||
unsafe { transmute(self) }
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
/// Given an FFI-safe reference obtained from Gecko converts it to a
|
|
||||||
/// Servo-side reference.
|
|
||||||
///
|
|
||||||
/// &GeckoType -> &ServoType
|
|
||||||
fn from_ffi(ffi: &Self::FFIType) -> &Self {
|
|
||||||
unsafe { transmute(ffi) }
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
/// Given an FFI-safe mutable reference obtained from Gecko converts it to a
|
|
||||||
/// Servo-side mutable reference.
|
|
||||||
///
|
|
||||||
/// &mut GeckoType -> &mut ServoType
|
|
||||||
fn from_ffi_mut(ffi: &mut Self::FFIType) -> &mut Self {
|
|
||||||
unsafe { transmute(ffi) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Helper trait for conversions between FFI Strong/Borrowed types and Arcs
|
/// Helper trait for conversions between FFI Strong/Borrowed types and Arcs
|
||||||
///
|
///
|
||||||
/// Should be implemented by types which are passed over FFI as Arcs via Strong
|
/// Should be implemented by types which are passed over FFI as Arcs via Strong
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue