Skip to main content

EngineManager

Struct EngineManager 

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

Implementations§

Source§

impl EngineManager

Source

pub fn builder() -> EngineManagerBuilder

Create an instance of EngineManager using the builder syntax

Source§

impl EngineManager

Source

pub async fn new_websocket_transport( ws: Upgraded, heartbeats: Option<u64>, ) -> Self

Source

pub fn new_mock() -> Self

Mock connection that doesn’t actually connect to anything. Used for testing.

Source

pub async fn take_responses(&self) -> IndexMap<Uuid, WebSocketResponse>

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

Source

pub async fn clear_scene( &self, batch_context: &EngineBatchContext, id_generator: &mut IdGenerator, source_range: SourceRange, ) -> Result<(), KclError>

Source

pub async fn ensure_async_command_completed( &self, id: Uuid, source_range: Option<SourceRange>, ) -> Result<OkWebSocketResponseData, KclError>

Ensure a specific async command has been completed.

Source

pub async fn ensure_async_commands_completed( &self, batch_context: &EngineBatchContext, ) -> Result<(), KclError>

Ensure ALL async commands have been completed.

Source

pub async fn reapply_settings( &self, batch_context: &EngineBatchContext, settings: &ExecutorSettings, source_range: SourceRange, id_generator: &mut IdGenerator, grid_scale_unit: GridScaleBehavior, ) -> Result<(), KclError>

Re-run the command to apply the settings.

Source

pub async fn batch_modeling_cmd( &self, batch_context: &EngineBatchContext, id: Uuid, source_range: SourceRange, cmd: &ModelingCmd, ) -> Result<(), KclError>

Source

pub async fn batch_modeling_cmds( &self, batch_context: &EngineBatchContext, source_range: SourceRange, cmds: &[ModelingCmdReq], ) -> Result<(), KclError>

Source

pub async fn batch_end_cmd( &self, batch_context: &EngineBatchContext, id: Uuid, source_range: SourceRange, cmd: &ModelingCmd, ) -> Result<(), KclError>

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

pub async fn send_modeling_cmd( &self, batch_context: &EngineBatchContext, id: Uuid, source_range: SourceRange, cmd: &ModelingCmd, ) -> Result<OkWebSocketResponseData, KclError>

Send the modeling cmd and wait for the response.

Source

pub async fn async_modeling_cmd( &self, id: Uuid, source_range: SourceRange, cmd: &ModelingCmd, ) -> Result<(), KclError>

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

Source

pub async fn flush_batch( &self, batch_context: &EngineBatchContext, batch_end: bool, source_range: SourceRange, ) -> Result<OkWebSocketResponseData, KclError>

Force flush the batch queue.

Source

pub async fn clear_queues(&self, batch_context: &EngineBatchContext)

Source

pub fn stats(&self) -> &EngineStats

Source

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

Source

pub async fn get_session_data(&self) -> Option<ModelingSessionData>

Source

pub async fn close(&self)

Trait Implementations§

Source§

impl Debug for EngineManager

Source§

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

Formats the value using the given formatter. 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> 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, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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> 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: Sized + 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: Sized + 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