ExternBlock

Struct ExternBlock 

Source
pub struct ExternBlock<Attr, Abi, Body> {
    pub attr: Attr,
    pub abi: Abi,
    pub body: Body,
}
Expand description

Declaration of an extern block, i.e. for FFI. In Rust 2024 and later, the unsafe keyword must be added for extern blocks. Thus, this struct requires that the context satisfies [ContextProvides] for Edition.

Fields§

§attr: Attr

The attributes. Must be a sequence, and each value will be placed inside #[].

§abi: Abi

The ABI chosen. Must be writable

§body: Body

The body of the extern block. Must be writable

Trait Implementations§

Source§

impl<O, Attr, Abi, Body> Writable<O> for ExternBlock<Attr, Abi, Body>
where O: Output, O::Ctx: ContextProvides<Edition>, Attr: WritableSeq<O>, Abi: Writable<O>, Body: Writable<O>,

Source§

async fn write_to(&self, output: &mut O) -> Result<(), O::Error>

Writes to the output. Returns the output’s error upon failure. Read more

Auto Trait Implementations§

§

impl<Attr, Abi, Body> Freeze for ExternBlock<Attr, Abi, Body>
where Attr: Freeze, Abi: Freeze, Body: Freeze,

§

impl<Attr, Abi, Body> RefUnwindSafe for ExternBlock<Attr, Abi, Body>
where Attr: RefUnwindSafe, Abi: RefUnwindSafe, Body: RefUnwindSafe,

§

impl<Attr, Abi, Body> Send for ExternBlock<Attr, Abi, Body>
where Attr: Send, Abi: Send, Body: Send,

§

impl<Attr, Abi, Body> Sync for ExternBlock<Attr, Abi, Body>
where Attr: Sync, Abi: Sync, Body: Sync,

§

impl<Attr, Abi, Body> Unpin for ExternBlock<Attr, Abi, Body>
where Attr: Unpin, Abi: Unpin, Body: Unpin,

§

impl<Attr, Abi, Body> UnwindSafe for ExternBlock<Attr, Abi, Body>
where Attr: UnwindSafe, Abi: UnwindSafe, Body: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.