EngineConnection

Struct EngineConnection 

Source
pub struct EngineConnection { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Debug for EngineConnection

Source§

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

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

impl EngineManager for EngineConnection

Source§

fn batch(&self) -> Arc<RwLock<Vec<(WebSocketRequest, SourceRange)>>>

Get the batch of commands to be sent to the engine.
Source§

fn batch_end( &self, ) -> Arc<RwLock<IndexMap<Uuid, (WebSocketRequest, SourceRange)>>>

Get the batch of end commands to be sent to the engine.
Source§

fn responses(&self) -> Arc<RwLock<IndexMap<Uuid, WebSocketResponse>>>

Get the command responses from the engine.
Source§

fn ids_of_async_commands(&self) -> Arc<RwLock<IndexMap<Uuid, SourceRange>>>

Get the ids of the async commands we are waiting for.
Source§

fn async_tasks(&self) -> AsyncTasks

Get the async tasks we are waiting for.
Source§

fn stats(&self) -> &EngineStats

Source§

fn get_default_planes(&self) -> Arc<RwLock<Option<DefaultPlanes>>>

Get the default planes.
Source§

fn get_debug<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<OkWebSocketResponseData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get any debug information (if requested)
Source§

fn fetch_debug<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch debug information from the peer.
Source§

fn clear_scene_post_hook<'life0, 'life1, 'async_trait>( &'life0 self, id_generator: &'life1 mut IdGenerator, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Helpers to be called after clearing a scene. (These really only apply to wasm for now).
Source§

fn inner_fire_modeling_cmd<'life0, 'async_trait>( &'life0 self, _id: Uuid, source_range: SourceRange, cmd: WebSocketRequest, _id_to_source_range: HashMap<Uuid, SourceRange>, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a modeling command and do not wait for the response message.
Source§

fn inner_send_modeling_cmd<'life0, 'async_trait>( &'life0 self, id: Uuid, source_range: SourceRange, cmd: WebSocketRequest, id_to_source_range: HashMap<Uuid, SourceRange>, ) -> Pin<Box<dyn Future<Output = Result<WebSocketResponse, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a modeling command and wait for the response message.
Source§

fn get_session_data<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<ModelingSessionData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get session data, if it has been received. Returns None if the server never sent it.
Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close the engine connection and wait for it to finish.
Source§

fn take_batch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<(WebSocketRequest, SourceRange)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Take the batch of commands that have accumulated so far and clear them.
Source§

fn take_batch_end<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = IndexMap<Uuid, (WebSocketRequest, SourceRange)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Take the batch of end commands that have accumulated so far and clear them.
Source§

fn take_ids_of_async_commands<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = IndexMap<Uuid, SourceRange>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Take the ids of async commands that have accumulated so far and clear them.
Source§

fn take_responses<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = IndexMap<Uuid, WebSocketResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Take the responses that have accumulated so far and clear them.
Source§

fn default_planes<'life0, 'life1, 'async_trait>( &'life0 self, id_generator: &'life1 mut IdGenerator, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<DefaultPlanes, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the default planes, creating them if they don’t exist.
Source§

fn clear_queues<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn clear_scene<'life0, 'life1, 'async_trait>( &'life0 self, id_generator: &'life1 mut IdGenerator, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn ensure_async_command_completed<'life0, 'async_trait>( &'life0 self, id: Uuid, source_range: Option<SourceRange>, ) -> Pin<Box<dyn Future<Output = Result<OkWebSocketResponseData, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Ensure a specific async command has been completed.
Source§

fn ensure_async_commands_completed<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Ensure ALL async commands have been completed.
Source§

fn set_edge_visibility<'life0, 'life1, 'async_trait>( &'life0 self, visible: bool, source_range: SourceRange, id_generator: &'life1 mut IdGenerator, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set the visibility of edges.
Source§

fn reapply_settings<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 ExecutorSettings, source_range: SourceRange, id_generator: &'life2 mut IdGenerator, grid_scale_unit: GridScaleBehavior, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Re-run the command to apply the settings.
Source§

fn batch_modeling_cmd<'life0, 'life1, 'async_trait>( &'life0 self, id: Uuid, source_range: SourceRange, cmd: &'life1 ModelingCmd, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn batch_modeling_cmds<'life0, 'life1, 'async_trait>( &'life0 self, source_range: SourceRange, cmds: &'life1 [ModelingCmdReq], ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn batch_end_cmd<'life0, 'life1, 'async_trait>( &'life0 self, id: Uuid, source_range: SourceRange, cmd: &'life1 ModelingCmd, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a command to the batch that needs to be executed at the very end. This for stuff like fillets or chamfers where if we execute too soon the engine will eat the ID and we can’t reference it for other commands.
Source§

fn send_modeling_cmd<'life0, 'life1, 'async_trait>( &'life0 self, id: Uuid, source_range: SourceRange, cmd: &'life1 ModelingCmd, ) -> Pin<Box<dyn Future<Output = Result<OkWebSocketResponseData, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send the modeling cmd and wait for the response.
Source§

fn async_modeling_cmd<'life0, 'life1, 'async_trait>( &'life0 self, id: Uuid, source_range: SourceRange, cmd: &'life1 ModelingCmd, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send the modeling cmd async and don’t wait for the response. Add it to our list of async commands.
Source§

fn run_batch<'life0, 'async_trait>( &'life0 self, orig_requests: Vec<(WebSocketRequest, SourceRange)>, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<OkWebSocketResponseData, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run the batch for the specific commands.
Source§

fn flush_batch<'life0, 'async_trait>( &'life0 self, batch_end: bool, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<OkWebSocketResponseData, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Force flush the batch queue.
Source§

fn make_default_plane<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, plane_id: Uuid, info: &'life1 PlaneInfo, color: Option<Color>, source_range: SourceRange, id_generator: &'life2 mut IdGenerator, ) -> Pin<Box<dyn Future<Output = Result<Uuid, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn new_default_planes<'life0, 'life1, 'async_trait>( &'life0 self, id_generator: &'life1 mut IdGenerator, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<DefaultPlanes, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn parse_websocket_response( &self, response: WebSocketResponse, source_range: SourceRange, ) -> Result<OkWebSocketResponseData, KclError>

Source§

fn parse_batch_responses( &self, id: Uuid, id_to_source_range: HashMap<Uuid, SourceRange>, responses: HashMap<Uuid, BatchResponse>, ) -> Result<OkWebSocketResponseData, KclError>

Source§

fn modify_grid<'life0, 'life1, 'async_trait>( &'life0 self, hidden: bool, grid_scale_behavior: GridScaleBehavior, source_range: SourceRange, id_generator: &'life1 mut IdGenerator, ) -> Pin<Box<dyn Future<Output = Result<(), KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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> IntoResult<T> for T

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<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T