#[repr(C)]pub struct EdgeInsets {
pub top: f64,
pub leading: f64,
pub bottom: f64,
pub trailing: f64,
}Expand description
SwiftUI.EdgeInsets — four insets, one per edge.
Four CGFloats and nothing else, which makes it a homogeneous float
aggregate: it travels in d0–d3 rather than by address, and comes back the
same way. That is why this is a #[repr(C)] struct of f64 and not a
tuple — a Rust tuple is not repr(C) and would be returned through memory.
Fields§
§top: f64The inset from the top edge.
leading: f64The inset from the leading edge — left in a left-to-right layout.
bottom: f64The inset from the bottom edge.
trailing: f64The inset from the trailing edge.
Implementations§
Source§impl EdgeInsets
impl EdgeInsets
Sourcepub fn from_swift(top: f64, leading: f64, bottom: f64, trailing: f64) -> Self
pub fn from_swift(top: f64, leading: f64, bottom: f64, trailing: f64) -> Self
EdgeInsets(top:leading:bottom:trailing:), built by SwiftUI itself.
The four fields are laid out exactly as this struct is, so constructing one in Rust would give the same bytes — this calls the initialiser anyway, because “the same bytes” is an assumption about a resilient type’s layout and the initialiser is the thing that is guaranteed.