Skip to main content

SlideBackground

Struct SlideBackground 

Source
pub struct SlideBackground<'a> { /* private fields */ }
Expand description

Slide 的“高阶背景“句柄(对标 python-pptx _Background)。

§能力

  • 只读视图:通过 fill_type() 查询当前背景填充类型;
  • 写入入口:通过 Slide 上的 set_background_solid / clear_background / set_follow_master_background 方法修改背景(这些方法直接写入 oxml 模型, 序列化时产出 <p:cSld><p:bg>...</p:bg></p:cSld>)。

§与 python-pptx 的差异

python-pptx 中 slide.background.fill.solid() 是链式写入;本库改为 slide.set_background_solid(color) 直接写入,避免可变句柄的生命周期问题。

Implementations§

Source§

impl<'a> SlideBackground<'a>

Source

pub fn fill_type(&self) -> MsoFillType

当前背景填充类型。

§返回值
  • MsoFillType::Inherit:未设置独立背景(inner.backgroundNoneReference);
  • MsoFillType::Solid:已设置纯色背景(inner.backgroundPropertysolid_fillNone);
  • 其它类型暂未支持,遇到时返回 Inherit 作为兜底。

Trait Implementations§

Source§

impl<'a> Debug for SlideBackground<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for SlideBackground<'a>

§

impl<'a> !Send for SlideBackground<'a>

§

impl<'a> !Sync for SlideBackground<'a>

§

impl<'a> !UnwindSafe for SlideBackground<'a>

§

impl<'a> Freeze for SlideBackground<'a>

§

impl<'a> Unpin for SlideBackground<'a>

§

impl<'a> UnsafeUnpin for SlideBackground<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V