pub(super) async fn from_table(table: &JsPerspectiveTable) -> Result<Self, JsValue> {
        let column_names = {
            let columns = table.columns().await?;
            if columns.length() > 0 {
                (0..columns.length())
                    .map(|i| columns.get(i).as_string().unwrap())
                    .collect::<Vec<String>>()
            } else {
                vec![]
            }
        };

        let table_schema = table.schema().await?.into_serde().into_jserror()?;
        let edit_port = table.make_port().await?;
        Ok(Self(Some(SessionMetadataState {
            column_names,
            table_schema,
            edit_port,
            ..SessionMetadataState::default()
        })))
    }
/// Creates a new `SessionMetadata` from a `JsPerspectiveTable`.
Creates a new `SessionMetadata` from a `JsPerspectiveTable`.
Creates a new ` SessionMetadata ` from a ` JsPerspectiveTable ` .
pub(super) async fn from_table(table: &JsPerspectiveTable) -> Result<Self, JsValue> {
        let column_names = {
            let columns = table.columns().await?;
            if columns.length() > 0 {
                (0..columns.length())
                    .map(|i| columns.get(i).as_string().unwrap())
                    .collect::<Vec<String>>()
            } else {
                vec![]
            }
        };
        let table_schema = table.schema().await?.into_serde().into_jserror()?;
        let edit_port = table.make_port().await?;
        Ok(Self(Some(SessionMetadataState {
            column_names,
            table_schema,
            edit_port,
            ..SessionMetadataState::default()
        })))
    }
pub ( super ) async fn from_table ( table : & JsPerspectiveTable ) -> Result < Self , JsValue > { let column_names = { let columns = table . columns ( ) . await ? ; if columns . length ( ) > 0 { ( 0 .. columns . length ( ) ) . map ( | i | columns . get ( i ) . as_string ( ) . unwrap ( ) ) . collect :: < Vec < String > > ( ) } else { vec ! [ ] } } ; let table_schema = table . schema ( ) . await ? . into_serde ( ) . into_jserror ( ) ? ; let edit_port = table . make_port ( ) . await ? ; Ok ( Self ( Some ( SessionMetadataState { column_names , table_schema , edit_port , .. SessionMetadataState :: default ( ) } ) ) ) }
Creates a new `SessionMetadata` from a `JsPerspectiveTable`.
Creates a new ` SessionMetadata ` from a ` JsPerspectiveTable ` .
table
&JsPerspectiveTable
table
&JsPerspectiveTable