pub struct ShareSectionConfig {
pub root: PathBuf,
pub max_file_bytes: u64,
pub max_total_bytes: u64,
pub max_files: usize,
pub targets: Vec<ShareTargetConfig>,
}Expand description
[share]: what a caller may share and where it may send it.
[share]
root = "/home/example/share"
max_file_bytes = 67108864
max_total_bytes = 268435456
max_files = 256
[[share.targets]]
name = "build-1"
url = "https://build-1.example/mcp"
key_file = "/home/example/.secrets/share-build-1.key"
call_timeout_s = 600The table and each target are closed. No value in them is a secret.
Fields§
§root: PathBufAbsolute path of the directory whose files may be shared. Everything under it can be shared, and nothing else.
max_file_bytes: u64The largest file a share sends, in bytes.
max_total_bytes: u64The most bytes one share sends, over all its files.
max_files: usizeThe most files one share names.
targets: Vec<ShareTargetConfig>The computers a share can go to.
Implementations§
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Check every rule of the table. Reads nothing from disk.
Sourcepub fn target(&self, name: &str) -> Option<&ShareTargetConfig>
pub fn target(&self, name: &str) -> Option<&ShareTargetConfig>
The target named name.
Trait Implementations§
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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