Skip to main content

Rectangle

Struct Rectangle 

Source
pub struct Rectangle(pub Arc<Rectangle>);
Expand description

Elicitation-enabled wrapper around bevy::math::primitives::Rectangle.

This newtype uses Arc internally to ensure Clone is always available, providing transparent access via Deref and DerefMut.

Tuple Fields§

§0: Arc<Rectangle>

Implementations§

Source§

impl Rectangle

Source

pub fn rectangle_half_size_x(&self) -> f32

Half-width.

Source

pub fn rectangle_half_size_y(&self) -> f32

Half-height.

Source

pub fn rectangle_new(&self, half_width: f32, half_height: f32) -> Rectangle

Constructs with half-width and half-height (ignores self).

Source§

impl Rectangle

Source

pub fn rectangle_half_size_x_tool_tool_attr() -> Tool

Generated tool metadata function for rectangle_half_size_x_tool

Source

pub fn rectangle_half_size_x_tool(&self) -> Result<Json<f32>, ErrorData>

rectangle_half_size_x MCP tool wrapper method.

Source

pub fn rectangle_half_size_y_tool_tool_attr() -> Tool

Generated tool metadata function for rectangle_half_size_y_tool

Source

pub fn rectangle_half_size_y_tool(&self) -> Result<Json<f32>, ErrorData>

rectangle_half_size_y MCP tool wrapper method.

Source

pub fn rectangle_new_tool_tool_attr() -> Tool

Generated tool metadata function for rectangle_new_tool

Source

pub fn rectangle_new_tool( &self, params: Parameters<RectangleNewParams>, ) -> Result<Json<Rectangle>, ErrorData>

rectangle_new MCP tool wrapper method.

Methods from Deref<Target = Rectangle>§

Source

pub fn size(&self) -> Vec2

Get the size of the rectangle

Source

pub fn closest_point(&self, point: Vec2) -> Vec2

Finds the point on the rectangle that is closest to the given point.

If the point is outside the rectangle, the returned point will be on the perimeter of the rectangle. Otherwise, it will be inside the rectangle and returned as is.

Trait Implementations§

Source§

impl AsRef<Rectangle> for Rectangle

Source§

fn as_ref(&self) -> &Rectangle

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Rectangle

Source§

fn clone(&self) -> Rectangle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Rectangle

Source§

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

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

impl Deref for Rectangle

Source§

type Target = Rectangle

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for Rectangle

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'de> Deserialize<'de> for Rectangle

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

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

impl ElicitComplete for Rectangle

Source§

fn validate_proofs_non_empty() -> bool

Runtime check: all three proof methods return non-empty TokenStreams. Read more
Source§

fn kani_proof_contains<Inner>() -> bool
where Inner: Elicitation,

Runtime check: does this type’s Kani proof contain Inner’s Kani proof? Read more
Source§

fn verus_proof_contains<Inner>() -> bool
where Inner: Elicitation,

Runtime check: does this type’s Verus proof contain Inner’s Verus proof?
Source§

fn creusot_proof_contains<Inner>() -> bool
where Inner: Elicitation,

Runtime check: does this type’s Creusot proof contain Inner’s Creusot proof?
Source§

impl ElicitIntrospect for Rectangle

Source§

fn pattern() -> ElicitationPattern

What elicitation pattern does this type use? Read more
Source§

fn metadata() -> TypeMetadata

Get the complete structural metadata for this type. Read more
Source§

impl ElicitPromptTree for Rectangle

Source§

fn prompt_tree() -> PromptTree

Return the static prompt tree for this type. Read more
Source§

fn assembled_prompts() -> Vec<AssembledPrompt>

Return the complete assembled prompts in elicitation order. Read more
Source§

impl ElicitSpec for Rectangle

Source§

fn type_spec() -> TypeSpec

Returns the complete spec for this type.
Source§

impl Elicitation for Rectangle

Source§

type Style = ()

The style enum for this type. Read more
Source§

async fn elicit<C: ElicitCommunicator>(_communicator: &C) -> ElicitResult<Self>

Elicit a value of this type from the user via style-aware client. Read more
Source§

fn kani_proof() -> TokenStream

Generate a Kani symbolic execution proof harness for this type. Read more
Source§

fn verus_proof() -> TokenStream

Returns a proc_macro2::TokenStream containing a Verus-verified function with requires/ensures specifications for this type’s invariants. Read more
Source§

fn creusot_proof() -> TokenStream

Returns a proc_macro2::TokenStream containing Creusot contract functions with #[requires]/#[ensures]/#[trusted] attributes for this type’s invariants. Read more
Source§

fn elicit_checked( peer: Peer<RoleServer>, ) -> impl Future<Output = Result<Self, ElicitError>> + Send

Server-side elicitation via MCP peer. Read more
Source§

fn with_style(style: Self::Style) -> ElicitBuilder<Self>

Create a builder for one-off style override. Read more
Source§

fn elicit_proven<C>( communicator: &C, ) -> impl Future<Output = Result<(Self, Established<Is<Self>>), ElicitError>> + Send

Elicit a value with proof it inhabits type Self. Read more
Source§

fn prusti_proof() -> TokenStream

Returns a proc_macro2::TokenStream containing Prusti contract functions with #[requires]/#[ensures] attributes for this type’s invariants. Read more
Source§

impl Eq for Rectangle

Source§

impl From<Arc<Rectangle>> for Rectangle

Source§

fn from(arc: Arc<Rectangle>) -> Self

Converts to this type from the input type.
Source§

impl From<Rectangle> for Arc<Rectangle>

Source§

fn from(wrapper: Rectangle) -> Self

Converts to this type from the input type.
Source§

impl From<Rectangle> for Rectangle

Source§

fn from(inner: Rectangle) -> Self

Converts to this type from the input type.
Source§

impl From<Rectangle> for Rectangle

Source§

fn from(v: Rectangle) -> Self

Converts to this type from the input type.
Source§

impl JsonSchema for Rectangle

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn json_schema(_gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

impl PartialEq for Rectangle

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Prompt for Rectangle

Source§

fn prompt() -> Option<&'static str>

Optional prompt to guide user interaction. Read more
Source§

impl Serialize for Rectangle

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

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

impl ToCodeLiteral for Rectangle

Source§

fn to_code_literal(&self) -> TokenStream

Return a TokenStream containing a single Rust expression whose evaluation produces a value equal to self.
Source§

fn type_tokens() -> TokenStream
where Self: Sized,

Token stream for the concrete type name (used to annotate None::<T>). Read more

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, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
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> 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> ConditionalSend for T
where T: Send,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

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

Source§

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

Source§

impl<T> DynEq for T
where T: Any + Eq,

Source§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
Source§

impl<T> ElicitJson for T
where T: JsonSchema + DeserializeOwned + Send + 'static,

Source§

async fn elicit_json<C>(communicator: &C) -> Result<T, ElicitError>

Elicit a value by presenting the JSON schema and parsing the response.
Source§

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

Source§

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

Compare self to key and return true if they are equal.
Source§

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

Source§

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

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

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

Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
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> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Refines<T> for T
where T: 'static,

Source§

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

Source§

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

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.
Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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

Source§

impl<T> WithContract for T
where T: Elicitation + Clone + Debug + Send,

Source§

fn with_contract<C>(contract: C) -> ContractedElicitation<Self, C>
where C: Contract<Input = Self, Output = Self> + Send + Sync + 'static,

Attach a contract to this type’s elicitation. 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