0.1.0
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// file: kb_decoder_amm_woofi/src/constants.rs
|
||||
// version: 2
|
||||
|
||||
//! Local constants for the `kb_decoder_amm_woofi` crate. Program identifiers live in `kb_program_ids`.
|
||||
|
||||
/// Canonical tracing target for this crate.
|
||||
pub(crate) const TRACING_TARGET: &str = "kb_decoder_amm_woofi";
|
||||
@@ -0,0 +1,41 @@
|
||||
// file: kb_decoder_amm_woofi/src/decoder.rs
|
||||
// version: 5
|
||||
|
||||
//! Decoder scaffold for the `kb_decoder_amm_woofi` crate.
|
||||
|
||||
/// Initial decoder implementation placeholder.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct AmmWoofiDecoder;
|
||||
|
||||
impl kb_decoder_api::ProtocolDecoder for crate::AmmWoofiDecoder {
|
||||
fn decoder_name(&self) -> &'static str {
|
||||
return "kb_decoder_amm_woofi";
|
||||
}
|
||||
|
||||
fn decoder_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn program_ids(&self) -> &'static [&'static str] {
|
||||
return &[kb_program_ids::AMM_WOOFI_PROGRAM_ID];
|
||||
}
|
||||
|
||||
fn supports_observation(
|
||||
&self,
|
||||
observation: &kb_model::ProgramObservation,
|
||||
) -> kb_decoder_api::DecoderSupport {
|
||||
return if self.handles_program_id(&observation.program_id) {
|
||||
kb_decoder_api::DecoderSupport::Maybe
|
||||
} else {
|
||||
kb_decoder_api::DecoderSupport::No
|
||||
};
|
||||
}
|
||||
|
||||
fn decode_observation(
|
||||
&self,
|
||||
_observation: &kb_model::ProgramObservation,
|
||||
) -> kb_core::Result<std::vec::Vec<kb_model::DecodedProtocolEvent>> {
|
||||
let _target = crate::TRACING_TARGET;
|
||||
return std::result::Result::Ok(std::vec::Vec::new());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// file: kb_decoder_amm_woofi/src/lib.rs
|
||||
// version: 2
|
||||
|
||||
//! Decoder crate for `amm_woofi`.
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
mod constants;
|
||||
mod decoder;
|
||||
|
||||
/// Canonical tracing target for this crate.
|
||||
pub(crate) use crate::constants::TRACING_TARGET;
|
||||
|
||||
/// Exposes the decoder type implemented by this crate.
|
||||
pub use crate::decoder::AmmWoofiDecoder;
|
||||
Reference in New Issue
Block a user