pub struct Placement { /* private fields */ }Expand description
An owned item and a placement in the original base scene’s CSS coordinates. One placement chooses a point or a box; its optional boundary is independent of its geometric target.
Implementations§
Source§impl Placement
impl Placement
Sourcepub fn at(
item: impl TryInto>,
at: impl TryInto>,
) -> Result<Placement, Error>where
<impl TryInto<CompositionSource> as TryInto<CompositionSource>>::Error: Into<Error>,
<impl TryInto<PlacePoint> as TryInto<PlacePoint>>::Error: Into<Error>,
pub fn at(
item: impl TryInto>,
at: impl TryInto>,
) -> Result<Placement, Error>where
<impl TryInto<CompositionSource> as TryInto<CompositionSource>>::Error: Into<Error>,
<impl TryInto<PlacePoint> as TryInto<PlacePoint>>::Error: Into<Error>,
Place a source by its own viewport anchor.
Sourcepub fn boxed(
item: impl TryInto>,
target: impl TryInto>,
) -> Result<Placement, Error>
pub fn boxed(
item: impl TryInto>,
target: impl TryInto>,
) -> Result<Placement, Error>
Fit a source into a real CSS rectangle or a frozen layout reference.
Sourcepub fn in_slot(
item: impl TryInto>,
row: usize,
column: usize,
) -> Result<Placement, Error>
pub fn in_slot(
item: impl TryInto>,
row: usize,
column: usize,
) -> Result<Placement, Error>
Use the complete allocated footprint of an actual reserved anchor.
Sourcepub fn fit(self, fit: ObjectFit) -> Placement
pub fn fit(self, fit: ObjectFit) -> Placement
Set an explicit fixed-source fitting policy for this box.
Sourcepub fn position(self, position: ObjectPosition) -> Placement
pub fn position(self, position: ObjectPosition) -> Placement
Set the object’s position within its box.
Sourcepub fn anchor(self, anchor: Anchor) -> Placement
pub fn anchor(self, anchor: Anchor) -> Placement
Choose the source viewport point for an at-placement.
Sourcepub fn size(self, width: f64, height: f64) -> Placement
pub fn size(self, width: f64, height: f64) -> Placement
Request an at-placement size in CSS pixels.
Sourcepub fn image_rendering(self, rendering: ImageRendering) -> Placement
pub fn image_rendering(self, rendering: ImageRendering) -> Placement
Set the sampling policy for an image source.
Sourcepub fn at_boundary(self, boundary: BoundaryRef) -> Placement
pub fn at_boundary(self, boundary: BoundaryRef) -> Placement
Use a real closed boundary of the original native base.
Source§impl Placement
impl Placement
Sourcepub fn get_recipe(&self) -> Result<Recipe, Error>
pub fn get_recipe(&self) -> Result<Recipe, Error>
Capture this actual content and placement without preparing a base.
Sourcepub fn get_recipe_with_operation(
&self,
options: &OperationOptions,
) -> Result<Recipe, Error>
pub fn get_recipe_with_operation( &self, options: &OperationOptions, ) -> Result<Recipe, Error>
Capture this placement under one cancellable declaration operation.
Sourcepub fn recipe(&self, path: impl AsRef<Path>) -> Result<Recipe, Error>
pub fn recipe(&self, path: impl AsRef<Path>) -> Result<Recipe, Error>
Write this placement and return that same independent Recipe.
Sourcepub fn recipe_with_operation(
&self,
path: impl AsRef<Path>,
options: &OperationOptions,
) -> Result<Recipe, Error>
pub fn recipe_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Recipe, Error>
Capture and atomically write the placement under one operation.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Placement
impl !UnwindSafe for Placement
impl Forget for Placement
impl Freeze for Placementwhere
*const PlotDescription is !null: Freeze,
PhantomData<PlotDescription>: Freeze,
*const Canvas is !null: Freeze,
PhantomData<Canvas>: Freeze,
*const ArcInner<String> is !null: Freeze,
PhantomData<ArcInner<String>>: Freeze,
*const ArcInner<Vec<FontFamily>> is !null: Freeze,
PhantomData<ArcInner<Vec<FontFamily>>>: Freeze,
*const ArcInner<TextInstructions> is !null: Freeze,
PhantomData<ArcInner<TextInstructions>>: Freeze,
*const ArcInner<Asset> is !null: Freeze,
PhantomData<ArcInner<Asset>>: Freeze,
*const ArcInner<PathBuf> is !null: Freeze,
PhantomData<ArcInner<PathBuf>>: Freeze,
*const ArcInner<RenderedScene> is !null: Freeze,
PhantomData<ArcInner<RenderedScene>>: Freeze,
*const ArcInner<SourceInfo> is !null: Freeze,
PhantomData<ArcInner<SourceInfo>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<PanelStep>: Freeze,
*const (PlacePoint, PlacePoint) is !null: Freeze,
PhantomData<(PlacePoint, PlacePoint)>: Freeze,
*const ArcInner<SpacingPayload> is !null: Freeze,
PhantomData<ArcInner<SpacingPayload>>: Freeze,
impl Move for Placement
impl Send for Placementwhere
BoxRaw<PlotDescription>: Send,
BoxRaw<Canvas>: Send,
Arc<String>: Send,
Arc<Vec<FontFamily>>: Send,
Arc<TextInstructions>: Send,
Arc<Asset>: Send,
Arc<PathBuf>: Send,
Arc<RenderedScene>: Send,
Arc<SourceInfo>: Send,
RawVecInner: Send,
Arc<[u8]>: Send,
BoxRaw<RawKey>: Send,
Arc<str>: Send,
BoxRaw<(PlacePoint, PlacePoint)>: Send,
Arc<SpacingPayload>: Send,
impl Sync for Placementwhere
BoxRaw<PlotDescription>: Sync,
BoxRaw<Canvas>: Sync,
Arc<String>: Sync,
Arc<Vec<FontFamily>>: Sync,
Arc<TextInstructions>: Sync,
Arc<Asset>: Sync,
Arc<PathBuf>: Sync,
Arc<RenderedScene>: Sync,
Arc<SourceInfo>: Sync,
RawVecInner: Sync,
Arc<[u8]>: Sync,
BoxRaw<RawKey>: Sync,
Arc<str>: Sync,
BoxRaw<(PlacePoint, PlacePoint)>: Sync,
Arc<SpacingPayload>: Sync,
impl Unpin for Placementwhere
Box<PlotDescription>: Unpin,
Box<Canvas>: Unpin,
Arc<String>: Unpin,
Arc<Vec<FontFamily>>: Unpin,
Arc<TextInstructions>: Unpin,
Arc<Asset>: Unpin,
Arc<PathBuf>: Unpin,
Arc<RenderedScene>: Unpin,
Arc<SourceInfo>: Unpin,
*const u8 is !null: Unpin,
Arc<[u8]>: Unpin,
Box<RawKey>: Unpin,
Arc<str>: Unpin,
Box<(PlacePoint, PlacePoint)>: Unpin,
Arc<SpacingPayload>: Unpin,
impl UnsafeUnpin for Placementwhere
*const PlotDescription is !null: UnsafeUnpin,
PhantomData<PlotDescription>: UnsafeUnpin,
*const Canvas is !null: UnsafeUnpin,
PhantomData<Canvas>: UnsafeUnpin,
*const ArcInner<String> is !null: UnsafeUnpin,
PhantomData<ArcInner<String>>: UnsafeUnpin,
*const ArcInner<Vec<FontFamily>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<FontFamily>>>: UnsafeUnpin,
*const ArcInner<TextInstructions> is !null: UnsafeUnpin,
PhantomData<ArcInner<TextInstructions>>: UnsafeUnpin,
*const ArcInner<Asset> is !null: UnsafeUnpin,
PhantomData<ArcInner<Asset>>: UnsafeUnpin,
*const ArcInner<PathBuf> is !null: UnsafeUnpin,
PhantomData<ArcInner<PathBuf>>: UnsafeUnpin,
*const ArcInner<RenderedScene> is !null: UnsafeUnpin,
PhantomData<ArcInner<RenderedScene>>: UnsafeUnpin,
*const ArcInner<SourceInfo> is !null: UnsafeUnpin,
PhantomData<ArcInner<SourceInfo>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<PanelStep>: UnsafeUnpin,
*const (PlacePoint, PlacePoint) is !null: UnsafeUnpin,
PhantomData<(PlacePoint, PlacePoint)>: UnsafeUnpin,
*const ArcInner<SpacingPayload> is !null: UnsafeUnpin,
PhantomData<ArcInner<SpacingPayload>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.