Skip to main content

SessionEngine

Struct SessionEngine 

Source
pub struct SessionEngine(/* private fields */);
Expand description

The Session struct is the principal interface to the Perspective engine, the Table and View objects for this viewer, and all associated state including the ViewConfig.

Implementations§

Source§

impl Session

Source

pub fn new() -> Self

Uses Self::new instead of Default to prevent accidental instantiation in props/etc.

Source

pub fn set_title(&self, title: Option<String>)

Source

pub fn reset( &self, options: ResetOptions, ) -> impl Future<Output = ApiResult<()>> + use<>

Reset this (presumably shared) Session to its initial state, returning a bool indicating whether this Session had a table which was deleted. TODO Table should be an immutable constructor parameter to Session.

Source

pub fn get_table(&self) -> Option<Table>

Source

pub fn set_client(&self, client: Client) -> bool

Source

pub fn get_client(&self) -> Option<Client>

Source

pub async fn set_table(&self, table_name: String) -> ApiResult<bool>

Reset this Session’s state with a new Table. Implicitly clears the ViewSubscription, which will need to be re-initialized later via create_view().

§Arguments
  • table_name The name of the Table to load, which must exist on the loaded Client.
§Returns

table_name is unique per Client, so if this value has not changed, Session::set_table does nothing and returns Ok(false).

Source

pub fn update_column_defaults(&self, requirements: &ViewConfigRequirements)

Source

pub async fn set_error(&self, reset_table: bool, err: ApiError) -> ApiResult<()>

Source

pub fn set_pause(&self, pause: bool) -> bool

Source

pub async fn await_table(&self) -> ApiResult<()>

Source

pub fn js_get_table(&self) -> Option<JsValue>

Source

pub async fn reconnect(&self) -> ApiResult<()>

Source

pub async fn validate_expr( &self, expr: &str, ) -> Result<Option<ExprValidationError>, ApiError>

Validate an expression string and marshall the results.

Source

pub async fn arrow_as_vec( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<Vec<u8>, ApiError>

Source

pub async fn arrow_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<ArrayBuffer, ApiError>

Source

pub async fn ndjson_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<JsString, ApiError>

Source

pub async fn json_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<Object, ApiError>

Source

pub async fn csv_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<JsString, ApiError>

Source

pub fn get_view(&self) -> Option<View>

Source

pub fn get_view_config(&self) -> Ref<'_, ViewConfig>

Source

pub async fn get_column_values( &self, column: String, ) -> Result<Vec<String>, ApiError>

Get all unique column values for a given column name.

Use the .to_csv() method, as I suspected copying this large string once was more efficient than copying many smaller strings, and string copying shows up frequently when doing performance analysis.

TODO Does not work with expressions yet.

§Arguments
  • column The name of the column (or expression).
Source

pub fn set_update_column_defaults( &self, config_update: &mut ViewConfigUpdate, requirements: &ViewConfigRequirements, )

Source

pub fn update_view_config( &self, config_update: ViewConfigUpdate, ) -> ApiResult<()>

Update the config, setting the columns property to the plugin defaults if provided.

Source

pub async fn validate(&self) -> Result<ValidSession<'_>, ApiError>

In order to create a new view in this session, the session must first be validated to create a ValidSession<'_> guard.

Source

pub fn to_props(&self) -> SessionProps

Snapshot the current session state as a [SessionProps] value suitable for passing as a Yew prop. Called by the root component whenever a session-related PubSub event fires.

Trait Implementations§

Source§

impl Clone for Session

Source§

fn clone(&self) -> Session

Returns a duplicate 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 Deref for Session

Source§

type Target = SessionHandle

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl ImplicitClone for Session

Source§

fn implicit_clone(&self) -> Self

This function is not magic; it is literally defined as Read more
Source§

impl PartialEq for Session

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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.

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> 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> 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> IntoPropValue<Option<T>> for T

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
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> 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> 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<Token, Builder, How> AllPropsFor<Builder, How> for Token
where Builder: Buildable<Token>, <Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,

Source§

impl<T> HasAllProps<(), T> for T