Skip to main content

Declared

Struct Declared 

Source
pub struct Declared {
Show 14 fields pub name: Option<String>, pub from: Option<String>, pub http: Option<String>, pub method: Option<String>, pub headers: IndexMap<String, String>, pub body: Option<String>, pub contains: Option<String>, pub follow: bool, pub send: Option<String>, pub tcp: Option<String>, pub exec: Option<String>, pub script: Option<String>, pub expect: Option<Expect>, pub wait: Option<u32>,
}
Expand description

A check Isoloom runs itself. Exactly one of http, tcp, exec and script says what to check; from says where from; expect what counts as passing.

Fields§

§name: Option<String>

Shown in results. Default: what the check does (http://web/ from user).

§from: Option<String>

The machine the check runs from (its networks, its routes, its view). Default: the access machine when the spec has one, else the environment’s networks at once.

§http: Option<String>

An HTTP(S) request to this URL. expect: a status code (default 200), any (an answer of any status), or blocked (nothing answers).

§method: Option<String>

With http: the request method (default GET).

§headers: IndexMap<String, String>

With http: request headers.

§body: Option<String>

With http: the request body, sent as is.

§contains: Option<String>

With http: text the response body must contain. With tcp: text the bytes read in the first 5 seconds of the connection (after send) must contain, like a banner.

§follow: bool

With http: follow redirects (up to 5 hops) and compare the final answer’s status, for a page that redirects (a login page, an app’s index). Default: the first answer counts. A POST followed by a 301, 302 or 303 goes on as a GET, as in a browser; other methods are sent again to each hop.

§send: Option<String>

With tcp and contains: a line written once connected (followed by a newline; end it with \r for CRLF), before reading.

§tcp: Option<String>

A TCP connection to host:port. expect: open (default) or blocked.

§exec: Option<String>

A command run inside the from machine (from is required). expect: text its output must contain (default: the command succeeds).

§script: Option<String>

A script in the project, run with sh from the from machine’s position; it exits 0 when the behavior holds.

§expect: Option<Expect>

What counts as passing, in the check’s own terms: a status code, any or blocked for http; open or blocked for tcp; text the output contains for exec. Each kind’s field says its default.

§wait: Option<u32>

How long to keep retrying until the check passes, as seconds (90) or a duration (90s, 3m, 1m30s): default 30 seconds for http and tcp (except blocked, tried once), 0 for exec and script. Held in seconds.

Trait Implementations§

Source§

impl Clone for Declared

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Declared

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Declared

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Declared

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Declared

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Declared

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Declared

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Declared

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.