pub struct OpencodeHeaders {
pub user_agent: SmolStr,
pub authorization: SmolStr,
pub host: Option<SmolStr>,
pub accept: SmolStr,
pub accept_encoding: SmolStr,
pub connection: SmolStr,
pub content_type: SmolStr,
pub content_length: Option<SmolStr>,
pub session_affinity: Option<SmolStr>,
pub parent_session_id: Option<SmolStr>,
}Expand description
Inbound headers consistently emitted by the OpenCode CLI persona.
Fields§
§user_agent: SmolStr§host: Option<SmolStr>Optional. NEVER stamped from a persona default: the persona-default
host (e.g. api.deepseek.com) is wrong for any other upstream and
caused real 403s when it leaked into Send. build only sets this
from inbound traffic; outbound transport derives Host from the URL.
accept: SmolStr§accept_encoding: SmolStr§connection: SmolStr§content_type: SmolStr§content_length: Option<SmolStr>§session_affinity: Option<SmolStr>§parent_session_id: Option<SmolStr>Implementations§
Source§impl OpencodeHeaders
impl OpencodeHeaders
Sourcepub fn build(vars: &TemplateVars, inbound: &HeaderMap) -> Self
pub fn build(vars: &TemplateVars, inbound: &HeaderMap) -> Self
Build an OpencodeHeaders from inbound transport headers and
correlation TemplateVars. Inbound values win for transport fields;
correlation fields prefer vars. Missing required fields fall back to
persona-specific defaults derived from real captured traffic.
Trait Implementations§
Source§impl Clone for OpencodeHeaders
impl Clone for OpencodeHeaders
Source§fn clone(&self) -> OpencodeHeaders
fn clone(&self) -> OpencodeHeaders
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 OpencodeHeaders
impl Debug for OpencodeHeaders
Source§impl<'de> Deserialize<'de> for OpencodeHeaders
impl<'de> Deserialize<'de> for OpencodeHeaders
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
impl Eq for OpencodeHeaders
Source§impl HeaderSchema for OpencodeHeaders
impl HeaderSchema for OpencodeHeaders
Source§fn parse(map: &HeaderMap) -> Result<Self, Error>
fn parse(map: &HeaderMap) -> Result<Self, Error>
Build the typed struct from a
HeaderMap. Returns Error::MissingHeader
when a required header is absent and Error::InvalidValue when a value
fails domain-specific validation.Source§fn known_names() -> &'static [&'static HeaderName]
fn known_names() -> &'static [&'static HeaderName]
All header names that this schema may emit. Useful for golden-test
allowlists and schema documentation.
Source§impl PartialEq for OpencodeHeaders
impl PartialEq for OpencodeHeaders
Source§impl Serialize for OpencodeHeaders
impl Serialize for OpencodeHeaders
impl StructuralPartialEq for OpencodeHeaders
Auto Trait Implementations§
impl Freeze for OpencodeHeaders
impl RefUnwindSafe for OpencodeHeaders
impl Send for OpencodeHeaders
impl Sync for OpencodeHeaders
impl Unpin for OpencodeHeaders
impl UnsafeUnpin for OpencodeHeaders
impl UnwindSafe for OpencodeHeaders
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