#[diplomat::bridge]
pub mod ffi {
use crate::errors::ffi::ICU4XError;
use crate::provider::ffi::ICU4XDataProvider;
use alloc::boxed::Box;
use icu_timezone::MetazoneCalculator;
#[diplomat::opaque]
#[diplomat::rust_link(icu::timezone::MetazoneCalculator, Struct)]
pub struct ICU4XMetazoneCalculator(pub MetazoneCalculator);
impl ICU4XMetazoneCalculator {
#[diplomat::rust_link(icu::timezone::MetazoneCalculator::new, FnInStruct)]
#[diplomat::attr(all(supports = constructors, supports = fallible_constructors), constructor)]
pub fn create(
provider: &ICU4XDataProvider,
) -> Result<Box<ICU4XMetazoneCalculator>, ICU4XError> {
Ok(Box::new(ICU4XMetazoneCalculator(call_constructor!(
MetazoneCalculator::new [r => Ok(r)],
MetazoneCalculator::try_new_with_any_provider,
MetazoneCalculator::try_new_with_buffer_provider,
provider,
)?)))
}
}
}