pub trait Crop<T, const N: usize>: Sized + IRectangle<T, N>where
T: Number,{
// Required method
fn crop(self, subrect: RectangleBase<Vector<T, N>>) -> Option<Self>;
// Provided methods
unsafe fn crop_unchecked(self, subrect: RectangleBase<Vector<T, N>>) -> Self { ... }
fn crop_or_panic(self, subrect: RectangleBase<Vector<T, N>>) -> Self { ... }
fn crop_intersect(self, subrect: RectangleBase<Vector<T, N>>) -> Self { ... }
fn crop_margin(
self,
margin_start: Vector<T, N>,
margin_end: Vector<T, N>,
) -> Option<Self> { ... }
unsafe fn crop_margin_unchecked(
self,
margin_start: Vector<T, N>,
margin_end: Vector<T, N>,
) -> Self { ... }
fn crop_margin_intersect(
self,
margin_start: Vector<T, N>,
margin_end: Vector<T, N>,
) -> Self { ... }
}Expand description
Crop a selection to a sub selection, where the sub selection is contained in the selection.
Required Methods§
Sourcefn crop(self, subrect: RectangleBase<Vector<T, N>>) -> Option<Self>
fn crop(self, subrect: RectangleBase<Vector<T, N>>) -> Option<Self>
Crop the current rectangle to the given sub rectangle.
The sub rectangle will always be inside the current rectangle.
Provided Methods§
Sourceunsafe fn crop_unchecked(self, subrect: RectangleBase<Vector<T, N>>) -> Self
unsafe fn crop_unchecked(self, subrect: RectangleBase<Vector<T, N>>) -> Self
Crop the current rectangle to the given sub rectangle.
The sub rectangle will always be inside the current rectangle.
Sourcefn crop_or_panic(self, subrect: RectangleBase<Vector<T, N>>) -> Self
fn crop_or_panic(self, subrect: RectangleBase<Vector<T, N>>) -> Self
Crop the current rectangle to the given sub rectangle.
The sub rectangle will always be inside the current rectangle.
Sourcefn crop_intersect(self, subrect: RectangleBase<Vector<T, N>>) -> Self
fn crop_intersect(self, subrect: RectangleBase<Vector<T, N>>) -> Self
Crop the current rectangle to the given sub rectangle.
The sub rectangle will always be inside the current rectangle. If the sub rectangle is outside or partially outside the current view, it will be intersected with the current rectangle.
fn crop_margin( self, margin_start: Vector<T, N>, margin_end: Vector<T, N>, ) -> Option<Self>
unsafe fn crop_margin_unchecked( self, margin_start: Vector<T, N>, margin_end: Vector<T, N>, ) -> Self
Sourcefn crop_margin_intersect(
self,
margin_start: Vector<T, N>,
margin_end: Vector<T, N>,
) -> Self
fn crop_margin_intersect( self, margin_start: Vector<T, N>, margin_end: Vector<T, N>, ) -> Self
Crop self by adding a margin to the start and the end of the current rectangle size.
The sub self will always be inside the self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.