Struct Localization

Source
pub struct Localization<G, P>
where G: BundleGenerator<LocalesIter = P::Iter>, P: LocalesProvider,
{ /* private fields */ }

Implementations§

Source§

impl<G, P> Localization<G, P>
where G: BundleGenerator<LocalesIter = P::Iter> + Default, P: LocalesProvider + Default,

Source

pub fn new<I>(res_ids: I, sync: bool) -> Self
where I: IntoIterator<Item = ResourceId>,

Source§

impl<G, P> Localization<G, P>
where G: BundleGenerator<LocalesIter = P::Iter>, P: LocalesProvider,

Source

pub fn with_env<I>(res_ids: I, sync: bool, provider: P, generator: G) -> Self
where I: IntoIterator<Item = ResourceId>,

Source

pub fn is_sync(&self) -> bool

Source

pub fn add_resource_id<T: Into<ResourceId>>(&mut self, res_id: T)

Source

pub fn add_resource_ids(&mut self, res_ids: Vec<ResourceId>)

Source

pub fn remove_resource_id<T: PartialEq<ResourceId>>( &mut self, res_id: T, ) -> usize

Source

pub fn remove_resource_ids(&mut self, res_ids: Vec<ResourceId>) -> usize

Source

pub fn set_async(&mut self)

Source

pub fn on_change(&mut self)

Source§

impl<G, P> Localization<G, P>
where G: BundleGenerator<LocalesIter = P::Iter>, G::Iter: BundleIterator, P: LocalesProvider,

Source

pub fn prefetch_sync(&mut self)

Source§

impl<G, P> Localization<G, P>
where G: BundleGenerator<LocalesIter = P::Iter>, G::Stream: BundleStream, P: LocalesProvider,

Source

pub async fn prefetch_async(&mut self)

Source§

impl<G, P> Localization<G, P>
where G: BundleGenerator<LocalesIter = P::Iter>, P: LocalesProvider,

Source

pub fn bundles(&self) -> &Rc<Bundles<G>>

Auto Trait Implementations§

§

impl<G, P> !Freeze for Localization<G, P>

§

impl<G, P> !RefUnwindSafe for Localization<G, P>

§

impl<G, P> !Send for Localization<G, P>

§

impl<G, P> !Sync for Localization<G, P>

§

impl<G, P> Unpin for Localization<G, P>
where G: Unpin, P: Unpin,

§

impl<G, P> !UnwindSafe for Localization<G, P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.