Struct gpui2::Size

source ·
#[repr(C)]
pub struct Size<T: Clone + Default + Debug> { pub width: T, pub height: T, }

Fields§

§width: T§height: T

Implementations§

source§

impl<T> Size<T>where T: Clone + Default + Debug,

source

pub fn map<U>(&self, f: impl Fn(T) -> U) -> Size<U>where U: Clone + Default + Debug,

source§

impl Size<Pixels>

source

pub fn scale(&self, factor: f32) -> Size<ScaledPixels>

source§

impl<T> Size<T>where T: PartialOrd + Clone + Default + Debug,

source

pub fn max(&self, other: &Self) -> Self

source§

impl Size<Length>

source

pub fn full() -> Self

source§

impl Size<DefiniteLength>

source

pub fn zero() -> Self

source§

impl Size<Length>

source

pub fn auto() -> Self

Trait Implementations§

source§

impl<T: Clone + Clone + Default + Debug> Clone for Size<T>

source§

fn clone(&self) -> Size<T>

Returns a copy 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<T> Debug for Size<T>where T: Clone + Default + Debug,

source§

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

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

impl<T: Default + Clone + Default + Debug> Default for Size<T>

source§

fn default() -> Size<T>

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

impl<'de, T> Deserialize<'de> for Size<T>where T: Deserialize<'de> + Clone + Default + Debug,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T, __RhsT: Copy> Div<__RhsT> for Size<T>where T: Div<__RhsT, Output = T> + Clone + Default + Debug,

§

type Output = Size<T>

The resulting type after applying the / operator.
source§

fn div(self, rhs: __RhsT) -> Size<T>

Performs the / operation. Read more
source§

impl From<NSRect> for Size<GlobalPixels>

source§

fn from(rect: NSRect) -> Self

Converts to this type from the input type.
source§

impl From<NSRect> for Size<Pixels>

source§

fn from(rect: NSRect) -> Self

Converts to this type from the input type.
source§

impl From<NSSize> for Size<Pixels>

source§

fn from(value: NSSize) -> Self

Converts to this type from the input type.
source§

impl<T: Clone + Default + Debug> From<Point<T>> for Size<T>

source§

fn from(point: Point<T>) -> Self

Converts to this type from the input type.
source§

impl From<Size<DevicePixels>> for Size

source§

fn from(size: Size<DevicePixels>) -> Self

Converts to this type from the input type.
source§

impl From<Size<Pixels>> for Size<AbsoluteLength>

source§

fn from(size: Size<Pixels>) -> Self

Converts to this type from the input type.
source§

impl From<Size<Pixels>> for Size<DefiniteLength>

source§

fn from(size: Size<Pixels>) -> Self

Converts to this type from the input type.
source§

impl From<Size<Pixels>> for Size<GlobalPixels>

source§

fn from(size: Size<Pixels>) -> Self

Converts to this type from the input type.
source§

impl<T, U> From<Size<T>> for Size<U>where T: Into<U>, U: Clone + Default + Debug,

source§

fn from(taffy_size: TaffySize<T>) -> Self

Converts to this type from the input type.
source§

impl<T, U> From<Size<T>> for Size<U>where T: Into<U> + Clone + Default + Debug,

source§

fn from(size: Size<T>) -> Self

Converts to this type from the input type.
source§

impl From<Size2D<i32, UnknownUnit>> for Size<DevicePixels>

source§

fn from(size: Size) -> Self

Converts to this type from the input type.
source§

impl<T: Clone + Default + Debug> From<SizeRefinement<T>> for Size<T>where Option<T>: Clone,

source§

fn from(value: SizeRefinement<T>) -> Self

Converts to this type from the input type.
source§

impl From<Vector2F> for Size<f32>

source§

fn from(vec: Vector2F) -> Self

Converts to this type from the input type.
source§

impl From<Vector2I> for Size<DevicePixels>

source§

fn from(value: Vector2I) -> Self

Converts to this type from the input type.
source§

impl<T: Hash + Clone + Default + Debug> Hash for Size<T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> IsZero for Size<T>where T: IsZero + Default + Debug + Clone,

source§

fn is_zero(&self) -> bool

source§

impl<T, Rhs> Mul<Rhs> for Size<T>where T: Mul<Rhs, Output = Rhs> + Clone + Default + Debug, Rhs: Clone + Default + Debug,

§

type Output = Size<Rhs>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Rhs) -> Self::Output

Performs the * operation. Read more
source§

impl<T, S> MulAssign<S> for Size<T>where T: Mul<S, Output = T> + Clone + Default + Debug, S: Clone,

source§

fn mul_assign(&mut self, rhs: S)

Performs the *= operation. Read more
source§

impl<T: PartialEq + Clone + Default + Debug> PartialEq<Size<T>> for Size<T>

source§

fn eq(&self, other: &Size<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Clone + Default + Debug> Refineable for Size<T>where Option<T>: Clone,

§

type Refinement = SizeRefinement<T>

source§

fn refine(&mut self, refinement: &Self::Refinement)

source§

fn refined(self, refinement: Self::Refinement) -> Self

§

fn from_cascade(cascade: &Cascade<Self>) -> Selfwhere Self: Default + Sized,

source§

impl<T> Serialize for Size<T>where T: Serialize + Clone + Default + Debug,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> Sub<Size<T>> for Size<T>where T: Sub<Output = T> + Clone + Default + Debug,

§

type Output = Size<T>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<T: Copy + Clone + Default + Debug> Copy for Size<T>

source§

impl<T> Eq for Size<T>where T: Eq + Default + Debug + Clone,

source§

impl<T: Clone + Default + Debug> StructuralPartialEq for Size<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Size<T>where T: RefUnwindSafe,

§

impl<T> Send for Size<T>where T: Send,

§

impl<T> Sync for Size<T>where T: Sync,

§

impl<T> Unpin for Size<T>where T: Unpin,

§

impl<T> UnwindSafe for Size<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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 Twhere 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> IsDefault for Twhere T: Default + PartialEq<T> + Copy,

source§

fn is_default(&self) -> bool

Checks that type has a default value.
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V

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> 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> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,