pub struct DecodeStructure {
pub decodable: bool,
pub decoded_len: usize,
pub printable_ratio: f32,
pub magic: Option<&'static str>,
pub protobuf_wire: bool,
}Expand description
Structured view of what a candidate decodes to. Carried as-is into the ML
feature vector once the model is retrained; consumed today by
is_encoded_binary.
Fields§
§decodable: boolThe candidate is a syntactically valid base64 (standard or url-safe) or hex string of a length worth decoding.
decoded_len: usizeNumber of bytes the candidate decoded to (0 when not decodable).
printable_ratio: f32Fraction of decoded bytes that are printable ASCII (incl. tab/newline).
magic: Option<&'static str>Identified container/format from the decoded magic bytes, if any.
protobuf_wire: boolThe decoded bytes parse end-to-end as a multi-field protobuf wire stream.
Implementations§
Source§impl DecodeStructure
impl DecodeStructure
Sourcepub fn is_binary_payload(&self) -> bool
pub fn is_binary_payload(&self) -> bool
True when the decoded bytes are an identifiable binary asset or a serialized protobuf message - i.e. data, not a credential.
Trait Implementations§
Source§impl Clone for DecodeStructure
impl Clone for DecodeStructure
Source§fn clone(&self) -> DecodeStructure
fn clone(&self) -> DecodeStructure
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 DecodeStructure
impl Debug for DecodeStructure
Source§impl Default for DecodeStructure
impl Default for DecodeStructure
Source§fn default() -> DecodeStructure
fn default() -> DecodeStructure
Returns the “default value” for a type. Read more
Source§impl PartialEq for DecodeStructure
impl PartialEq for DecodeStructure
Source§fn eq(&self, other: &DecodeStructure) -> bool
fn eq(&self, other: &DecodeStructure) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DecodeStructure
Auto Trait Implementations§
impl Freeze for DecodeStructure
impl RefUnwindSafe for DecodeStructure
impl Send for DecodeStructure
impl Sync for DecodeStructure
impl Unpin for DecodeStructure
impl UnsafeUnpin for DecodeStructure
impl UnwindSafe for DecodeStructure
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,
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