pub struct TaskInfo<'a> {
inner: &'a ContextInner,
}Expand description
Read-only view of task metadata: the task ID, sample file path, and key-value configuration submitted with the task.
Fields§
§inner: &'a ContextInnerImplementations§
Source§impl TaskInfo<'_>
impl TaskInfo<'_>
Sourcepub fn sample_path(&self) -> &Path
pub fn sample_path(&self) -> &Path
Path to the sample file on disk.
Sourcepub fn sample_bytes(&self) -> Result<Vec<u8>>
pub fn sample_bytes(&self) -> Result<Vec<u8>>
Read the entire sample file into memory. Be mindful of large samples.
Sourcepub fn config(&self) -> &HashMap<String, String>
pub fn config(&self) -> &HashMap<String, String>
The full key-value configuration map submitted with the task.
Sourcepub fn config_value(&self, key: &str) -> Option<&str>
pub fn config_value(&self, key: &str) -> Option<&str>
Look up a single value from the task configuration. Returns None
if the key is not present.
Auto Trait Implementations§
impl<'a> Freeze for TaskInfo<'a>
impl<'a> !RefUnwindSafe for TaskInfo<'a>
impl<'a> Send for TaskInfo<'a>
impl<'a> Sync for TaskInfo<'a>
impl<'a> Unpin for TaskInfo<'a>
impl<'a> UnsafeUnpin for TaskInfo<'a>
impl<'a> !UnwindSafe for TaskInfo<'a>
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].