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: StringFile path (absolute or relative)
sections: Vec<Section>All sections in the document (preserving order)
metadata: DocumentMetadataDocument metadata
next_document: Option<Box<GctfDocument>>Next document in chain (for multi-document files)
Implementations§
Source§impl GctfDocument
impl GctfDocument
Sourcepub fn new(file_path: String) -> GctfDocument
pub fn new(file_path: String) -> GctfDocument
Create a new empty document
Sourcepub fn get_document(&self, index: usize) -> Option<&GctfDocument>
pub fn get_document(&self, index: usize) -> Option<&GctfDocument>
Get document by index (0-based) from the chain
pub fn iter_chain(&self) -> DocumentChainIter<'_> ⓘ
pub fn document_count(&self) -> usize
pub fn is_single_document(&self) -> bool
Sourcepub fn sections_by_type(&self, section_type: SectionType) -> Vec<&Section>
pub fn sections_by_type(&self, section_type: SectionType) -> Vec<&Section>
Get all sections of a specific type
Sourcepub fn first_section(&self, section_type: SectionType) -> Option<&Section>
pub fn first_section(&self, section_type: SectionType) -> Option<&Section>
Get first section of a specific type
Sourcepub fn get_address(&self, env_address: Option<&str>) -> Option<String>
pub fn get_address(&self, env_address: Option<&str>) -> Option<String>
Get address (from ADDRESS section or environment variable)
Sourcepub fn get_endpoint(&self) -> Option<String>
pub fn get_endpoint(&self) -> Option<String>
Get endpoint
Sourcepub fn parse_endpoint(&self) -> Option<(String, String, String)>
pub fn parse_endpoint(&self) -> Option<(String, String, String)>
Parse endpoint into package, service, method
Sourcepub fn get_requests(&self) -> Vec<Value>
pub fn get_requests(&self) -> Vec<Value>
Get all request payloads
Sourcepub fn get_assertions(&self) -> Vec<Vec<String>>
pub fn get_assertions(&self) -> Vec<Vec<String>>
Get all assertion sections
Sourcepub fn get_tls_config_with_defaults(
&self,
defaults: &HashMap<String, String>,
) -> Option<HashMap<String, String>>
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)
Sourcepub fn has_response_error_conflict(&self) -> bool
pub fn has_response_error_conflict(&self) -> bool
Check for RESPONSE and ERROR conflict
pub fn section_uses_deprecated_headers_alias(&self, section: &Section) -> bool
Trait Implementations§
Source§impl Clone for GctfDocument
impl Clone for GctfDocument
Source§fn clone(&self) -> GctfDocument
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GctfDocument
impl Debug for GctfDocument
Source§impl<'de> Deserialize<'de> for GctfDocument
impl<'de> Deserialize<'de> for GctfDocument
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GctfDocument, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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
impl PartialEq for GctfDocument
Source§impl Serialize for GctfDocument
impl Serialize for GctfDocument
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl StructuralPartialEq for GctfDocument
Auto Trait Implementations§
impl Freeze for GctfDocument
impl RefUnwindSafe for GctfDocument
impl Send for GctfDocument
impl Sync for GctfDocument
impl Unpin for GctfDocument
impl UnsafeUnpin for GctfDocument
impl UnwindSafe for GctfDocument
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