AddToCache

Trait AddToCache 

Source
pub trait AddToCache {
    // Required method
    fn add_to_cache(self, cache: &mut *mut mu_Cache) -> *mut mu_Source;
}
Expand description

Trait for types that can be added to a cache.

This trait is automatically implemented for common types:

  • &str - Borrowed string content
  • String - Owned string content (stored in cache)
  • OwnedSource<S> - Any type implementing AsRef<[u8]> (Vec<u8>, Box<[u8]>, etc.)
  • Tuples with filename: (&str, &str), (String, &str)
  • Custom Source trait implementations

Users typically don’t need to implement this trait directly.

Required Methods§

Source

fn add_to_cache(self, cache: &mut *mut mu_Cache) -> *mut mu_Source

Add this source to the cache.

§Parameters
  • cache: Mutable reference to the C cache pointer
§Returns

Pointer to the created mu_Source in the C library

Implementations on Foreign Types§

Source§

impl AddToCache for &str

Source§

fn add_to_cache(self, cache: &mut *mut mu_Cache) -> *mut mu_Source

Source§

impl AddToCache for String

Source§

fn add_to_cache(self, cache: &mut *mut mu_Cache) -> *mut mu_Source

Source§

impl<S: AddToCache> AddToCache for (S, &str)

Source§

fn add_to_cache(self, cache: &mut *mut mu_Cache) -> *mut mu_Source

Source§

impl<S: AddToCache> AddToCache for (S, &str, i32)

Source§

fn add_to_cache(self, cache: &mut *mut mu_Cache) -> *mut mu_Source

Implementors§