Skip to main content

co_actor/
task_options.rs

1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (C) 2026 1io BRANDGUARDIAN GmbH
3
4#[derive(Debug, Default)]
5pub struct TaskOptions {
6	pub name: Option<&'static str>,
7
8	/// Untracked mode.
9	///
10	/// Use this for services which usually depend on callers and use own life-cycle.
11	pub untracked: bool,
12}
13impl TaskOptions {
14	pub fn new(name: &'static str) -> Self {
15		Self { name: Some(name), untracked: false }
16	}
17
18	pub fn untracked() -> Self {
19		Self { name: None, untracked: true }
20	}
21
22	pub fn with_untracked(mut self) -> Self {
23		self.untracked = true;
24		self
25	}
26}