artichoke_backend/extn/stdlib/base64/
mod.rs

1use std::ffi::CStr;
2
3use crate::extn::prelude::*;
4
5const BASE64_CSTR: &CStr = c"Base64";
6static BASE64_RUBY_SOURCE: &[u8] = include_bytes!("vendor/base64.rb");
7
8pub fn init(interp: &mut Artichoke) -> InitializeResult<()> {
9    let spec = module::Spec::new(interp, "Base64", BASE64_CSTR, None)?;
10    interp.def_module::<Base64>(spec)?;
11    interp.def_rb_source_file("base64.rb", BASE64_RUBY_SOURCE)?;
12
13    Ok(())
14}
15
16#[derive(Debug, Clone, Copy)]
17pub struct Base64;