vizia::vg::resources

Trait ResourceProvider

pub trait ResourceProvider {
    // Required methods
    fn load(
        &self,
        resource_path: &str,
        resource_name: &str,
    ) -> Option<RCHandle<SkData>>;
    fn load_typeface(
        &self,
        name: &str,
        url: &str,
    ) -> Option<RCHandle<SkTypeface>>;
    fn font_mgr(&self) -> RCHandle<SkFontMgr>;

    // Provided method
    fn load_image_asset(
        &self,
        resource_path: &str,
        resource_name: &str,
        _resource_id: &str,
    ) -> Option<RCHandle<skresources_ImageAsset>> { ... }
}

Required Methods§

fn load( &self, resource_path: &str, resource_name: &str, ) -> Option<RCHandle<SkData>>

fn load_typeface(&self, name: &str, url: &str) -> Option<RCHandle<SkTypeface>>

fn font_mgr(&self) -> RCHandle<SkFontMgr>

This is used in the SVG Dom and should be used for ipmlementing load_typeface().

Provided Methods§

fn load_image_asset( &self, resource_path: &str, resource_name: &str, _resource_id: &str, ) -> Option<RCHandle<skresources_ImageAsset>>

Implementors§