Skip to main content

GctfDocument

Struct GctfDocument 

Source
pub struct GctfDocument {
    pub file_path: String,
    pub sections: Vec<Section>,
    pub metadata: DocumentMetadata,
    pub next_document: Option<Box<GctfDocument>>,
}
Expand description

Complete .gctf document

Fields§

§file_path: String

File path (absolute or relative)

§sections: Vec<Section>

All sections in the document (preserving order)

§metadata: DocumentMetadata

Document metadata

§next_document: Option<Box<GctfDocument>>

Next document in chain (for multi-document files)

Implementations§

Source§

impl GctfDocument

Source

pub fn new(file_path: String) -> GctfDocument

Create a new empty document

Source

pub fn get_document(&self, index: usize) -> Option<&GctfDocument>

Get document by index (0-based) from the chain

Source

pub fn iter_chain(&self) -> DocumentChainIter<'_>

Source

pub fn document_count(&self) -> usize

Source

pub fn is_single_document(&self) -> bool

Source

pub fn sections_by_type(&self, section_type: SectionType) -> Vec<&Section>

Get all sections of a specific type

Source

pub fn first_section(&self, section_type: SectionType) -> Option<&Section>

Get first section of a specific type

Source

pub fn get_address(&self, env_address: Option<&str>) -> Option<String>

Get address (from ADDRESS section or environment variable)

Source

pub fn get_endpoint(&self) -> Option<String>

Get endpoint

Source

pub fn parse_endpoint(&self) -> Option<(String, String, String)>

Parse endpoint into package, service, method

Source

pub fn get_requests(&self) -> Vec<Value>

Get all request payloads

Source

pub fn get_assertions(&self) -> Vec<Vec<String>>

Get all assertion sections

Source

pub fn get_request_headers(&self) -> Option<HashMap<String, String>>

Get request headers

Source

pub fn get_tls_config(&self) -> Option<HashMap<String, String>>

Get TLS configuration

Source

pub fn get_options(&self) -> Option<HashMap<String, String>>

Get OPTIONS configuration

Source

pub fn get_tls_config_with_defaults( &self, defaults: &HashMap<String, String>, ) -> Option<HashMap<String, String>>

Get TLS configuration merged with defaults (section values override defaults)

Source

pub fn get_proto_config(&self) -> Option<HashMap<String, String>>

Get PROTO configuration

Source

pub fn has_response_error_conflict(&self) -> bool

Check for RESPONSE and ERROR conflict

Source

pub fn section_uses_deprecated_headers_alias(&self, section: &Section) -> bool

Trait Implementations§

Source§

impl Clone for GctfDocument

Source§

fn clone(&self) -> GctfDocument

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 GctfDocument

Source§

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

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

impl<'de> Deserialize<'de> for GctfDocument

Source§

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

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

impl PartialEq for GctfDocument

Source§

fn eq(&self, other: &GctfDocument) -> 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 GctfDocument

Source§

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

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

impl StructuralPartialEq for GctfDocument

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.