pub struct Session { /* private fields */ }Expand description
A connected session: the server’s info, and the recording this client has open.
Implementations§
Source§impl Session
impl Session
Sourcepub async fn connect(
addr: SocketAddr,
server_name: &str,
config: ClientConfig,
) -> StreamResult<Self>
pub async fn connect( addr: SocketAddr, server_name: &str, config: ClientConfig, ) -> StreamResult<Self>
Connects to addr (certificate checked against server_name per config) and reads the
server’s info. The local endpoint uses the address family of addr.
Sourcepub fn with_max_message_bytes(self, bytes: usize) -> Self
pub fn with_max_message_bytes(self, bytes: usize) -> Self
Accepts messages up to bytes long (default DEFAULT_MAX_MESSAGE_BYTES).
Sourcepub fn server(&self) -> &ServerInfo
pub fn server(&self) -> &ServerInfo
Who the server is, who this client is to it, and what it may do.
Sourcepub fn recording(&self) -> Option<&RecordingInfo>
pub fn recording(&self) -> Option<&RecordingInfo>
The recording this client has open (channels, units, exact rate, stored format): the
server’s initial one, or the last Self::opened.
Sourcepub async fn subscribe(
&mut self,
first_sample: u64,
) -> StreamResult<SignalReceiver>
pub async fn subscribe( &mut self, first_sample: u64, ) -> StreamResult<SignalReceiver>
Starts (or restarts) the signal of the open recording at first_sample.
Sourcepub async fn view(&self, view: &View) -> StreamResult<Envelope>
pub async fn view(&self, view: &View) -> StreamResult<Envelope>
The server’s answer to view of the open recording.
Sourcepub async fn list_files(&self, dir: &str) -> StreamResult<FileList>
pub async fn list_files(&self, dir: &str) -> StreamResult<FileList>
The entries of directory dir under the server’s data root (“” = the root).
Sourcepub async fn configure(&self, job: Configure) -> StreamResult<Status>
pub async fn configure(&self, job: Configure) -> StreamResult<Status>
Sets the server’s job (control permission; only while nothing runs).
Sourcepub async fn start(&self) -> StreamResult<Status>
pub async fn start(&self) -> StreamResult<Status>
Starts the configured job (control permission).
Sourcepub async fn stop(&self) -> StreamResult<Status>
pub async fn stop(&self) -> StreamResult<Status>
Asks the running job to stop (control permission).
Sourcepub async fn status(&self) -> StreamResult<Status>
pub async fn status(&self) -> StreamResult<Status>
The server’s state and its job’s progress.
Sourcepub async fn logs(&self, lines: u32) -> StreamResult<Vec<String>>
pub async fn logs(&self, lines: u32) -> StreamResult<Vec<String>>
The job’s last lines log lines (0 = all the server keeps).
Sourcepub async fn fetch_file(&self, path: &str, dest: &Path) -> StreamResult<u64>
pub async fn fetch_file(&self, path: &str, dest: &Path) -> StreamResult<u64>
Fetches the file path under the server’s data root into dest (a new file, never
overwritten); returns its size. A directory is fetched with Self::fetch.
Sourcepub async fn fetch(&self, path: &str, dest: &Path) -> StreamResult<(usize, u64)>
pub async fn fetch(&self, path: &str, dest: &Path) -> StreamResult<(usize, u64)>
Fetches path (a file, or a directory such as a .sorting.zarr, file by file) into the new
local path dest; returns files and bytes. Names from the server are checked: plain, not
hidden, no separators, so nothing lands outside dest.
Sourcepub async fn open(
&mut self,
path: &str,
source: Option<&str>,
) -> StreamResult<&RecordingInfo>
pub async fn open( &mut self, path: &str, source: Option<&str>, ) -> StreamResult<&RecordingInfo>
Opens the recording at path under the server’s data root (source: one of the file’s
sources, None = its default); views and the signal are then of it.
Auto Trait Implementations§
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin 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> 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 more