Skip to main content

CustomRect

Struct CustomRect 

Source
pub struct CustomRect {
Show 16 fields pub basic_front_resource_config: BasicFrontResourceConfig, pub position: [f32; 2], pub size: [f32; 2], pub display_info: DisplayInfo, pub rounding: f32, pub color: [u8; 3], pub alpha: u8, pub overlay_color: [u8; 3], pub overlay_alpha: u8, pub border_width: f32, pub border_color: [u8; 3], pub border_alpha: u8, pub overlay_border_color: [u8; 3], pub overlay_border_alpha: u8, pub border_kind: BorderKind, pub tags: Vec<[String; 2]>,
}
Expand description

Custom rectangle resource for drawing rectangles with various visual properties.

自定义矩形资源,用于绘制具有各种视觉属性的矩形。

Fields§

§basic_front_resource_config: BasicFrontResourceConfig

Config for basic front resource properties.

基本前端资源属性配置。

§position: [f32; 2]

Current display position of the rectangle as [x, y].

矩形的当前显示位置,为[x, y]。

§size: [f32; 2]

Current display size of the rectangle as [width, height].

矩形的当前显示尺寸,为[width, height]。

§display_info: DisplayInfo

Display info controlling visibility and rendering.

显示信息,控制可见性和渲染。

§rounding: f32

Radius for rounded corners.

圆角。

§color: [u8; 3]

Fill color of the rectangle as [R, G, B].

填充矩形颜色,为[R, G, B]。

§alpha: u8

Opacity of the rectangle (0-255).

矩形的不透明度(0-255)。

§overlay_color: [u8; 3]

Fill color overlay of the rectangle as [R, G, B].

矩形的填充颜色覆盖层,格式为[R, G, B]。

§overlay_alpha: u8

Opacity of the fill color overlay (0-255).

矩形的填充颜色覆盖层不透明度(0-255)。

§border_width: f32

Width of the border.

边框宽度。

§border_color: [u8; 3]

Color of the border as [R, G, B].

边框颜色,为[R, G, B]。

§border_alpha: u8

Opacity of the border (0-255).

边框的不透明度(0-255)。

§overlay_border_color: [u8; 3]

Color overlay of the border as [R, G, B].

边框的颜色覆盖层,格式为[R, G, B]。

§overlay_border_alpha: u8

Opacity of the border color overlay (0-255).

边框的颜色覆盖层不透明度(0-255)。

§border_kind: BorderKind

Placement of the border relative to the rectangle’s bounds.

边框相对于矩形边界的位置。

§tags: Vec<[String; 2]>

Key-value pairs for categorization and metadata.

用于分类和元数据的键值对标签。

Implementations§

Source§

impl CustomRect

Source

pub fn from_config(self, config: &CustomRectConfig) -> Self

Source

pub fn basic_front_resource_config( self, basic_front_resource_config: &BasicFrontResourceConfig, ) -> Self

Source

pub fn hidden(self, hidden: bool) -> Self

Source

pub fn ignore_render_layer(self, ignore_render_layer: bool) -> Self

Source

pub fn rounding(self, rounding: f32) -> Self

Source

pub fn color(self, r: u8, g: u8, b: u8) -> Self

Source

pub fn alpha(self, alpha: u8) -> Self

Source

pub fn overlay_color(self, r: u8, g: u8, b: u8) -> Self

Source

pub fn overlay_alpha(self, overlay_alpha: u8) -> Self

Source

pub fn border_width(self, border_width: f32) -> Self

Source

pub fn border_color(self, r: u8, g: u8, b: u8) -> Self

Source

pub fn border_alpha(self, border_alpha: u8) -> Self

Source

pub fn overlay_border_color(self, r: u8, g: u8, b: u8) -> Self

Source

pub fn overlay_border_alpha(self, overlay_border_alpha: u8) -> Self

Source

pub fn border_kind(self, border_kind: BorderKind) -> Self

Source

pub fn tags(self, tags: &[[String; 2]], replace: bool) -> Self

Trait Implementations§

Source§

impl BasicFrontResource for CustomRect

Source§

fn display_basic_front_resource_config(&self) -> BasicFrontResourceConfig

Returns the complete basic resource config. Read more
Source§

fn display_position_size_config(&self) -> PositionSizeConfig

Returns the position and size config for this resource. Read more
Source§

fn display_clip_rect(&self) -> Option<PositionSizeConfig>

Returns the clipping rectangle config if this resource has one. Read more
Source§

fn display_position(&self) -> [f32; 2]

Returns the current display position of the resource. Read more
Source§

fn display_size(&self) -> [f32; 2]

Returns the current display size of the resource. Read more
Source§

fn modify_basic_front_resource_config( &mut self, basic_front_resource_config: BasicFrontResourceConfig, )

Updates the complete basic resource config. Read more
Source§

fn modify_position_size_config( &mut self, position_size_config: PositionSizeConfig, )

Updates the position and size config. Read more
Source§

fn modify_clip_rect(&mut self, clip_rect: Option<PositionSizeConfig>)

Updates the clipping rectangle config. Read more
Source§

impl Clone for CustomRect

Source§

fn clone(&self) -> CustomRect

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CustomRect

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for CustomRect

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for CustomRect

Source§

fn eq(&self, other: &CustomRect) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for CustomRect

Source§

fn partial_cmp(&self, other: &CustomRect) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl RustConstructorResource for CustomRect

Source§

fn as_any(&self) -> &dyn Any

Returns a reference to the resource as Any for extract the specific type. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Returns a mutable reference to the resource as Any for extract the specific type. Read more
Source§

fn display_display_info(&self) -> Option<DisplayInfo>

Retrieves the display info field for this resource. Read more
Source§

fn modify_display_info(&mut self, display_info: DisplayInfo)

Updates the display info field for this resource. Read more
Source§

fn display_tags(&self) -> Vec<[String; 2]>

Returns all tags associated with this resource. Read more
Source§

fn modify_tags(&mut self, tags: &[[String; 2]], replace: bool)

Updates the tags for this resource. Read more
Source§

impl StructuralPartialEq for CustomRect

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

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

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,