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
impl Session
pub fn set_title(&self, title: Option<String>)
Sourcepub fn reset(
&self,
options: ResetOptions,
) -> impl Future<Output = ApiResult<()>> + use<>
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.
pub fn get_table(&self) -> Option<Table>
pub fn set_client(&self, client: Client) -> bool
pub fn get_client(&self) -> Option<Client>
Sourcepub async fn set_table(&self, table_name: String) -> ApiResult<bool>
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_nameThe name of theTableto load, which must exist on the loadedClient.
§Returns
table_name is unique per Client, so if this value has not changed,
Session::set_table does nothing and returns Ok(false).
pub fn update_column_defaults(&self, requirements: &ViewConfigRequirements)
pub async fn set_error(&self, reset_table: bool, err: ApiError) -> ApiResult<()>
pub fn set_pause(&self, pause: bool) -> bool
pub async fn await_table(&self) -> ApiResult<()>
pub fn js_get_table(&self) -> Option<JsValue>
pub async fn reconnect(&self) -> ApiResult<()>
Sourcepub async fn validate_expr(
&self,
expr: &str,
) -> Result<Option<ExprValidationError>, ApiError>
pub async fn validate_expr( &self, expr: &str, ) -> Result<Option<ExprValidationError>, ApiError>
Validate an expression string and marshall the results.
pub async fn arrow_as_vec( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<Vec<u8>, ApiError>
pub async fn arrow_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<ArrayBuffer, ApiError>
pub async fn ndjson_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<JsString, ApiError>
pub async fn json_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<Object, ApiError>
pub async fn csv_as_jsvalue( &self, flat: bool, window: Option<ViewWindow>, ) -> Result<JsString, ApiError>
pub fn get_view(&self) -> Option<View>
pub fn get_view_config(&self) -> Ref<'_, ViewConfig>
Sourcepub async fn get_column_values(
&self,
column: String,
) -> Result<Vec<String>, ApiError>
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
columnThe name of the column (or expression).
pub fn set_update_column_defaults( &self, config_update: &mut ViewConfigUpdate, requirements: &ViewConfigRequirements, )
Sourcepub fn update_view_config(
&self,
config_update: ViewConfigUpdate,
) -> ApiResult<()>
pub fn update_view_config( &self, config_update: ViewConfigUpdate, ) -> ApiResult<()>
Update the config, setting the columns property to the plugin defaults
if provided.
Trait Implementations§
Source§impl ImplicitClone for Session
impl ImplicitClone for Session
Source§fn implicit_clone(&self) -> Self
fn implicit_clone(&self) -> Self
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl !Send for Session
impl !Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl !UnwindSafe for Session
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.