pub struct Files { /* private fields */ }Implementations§
Source§impl Files
impl Files
Sourcepub fn new(user: Option<PathBuf>, host: PathBuf, sessions: PathBuf) -> Files
pub fn new(user: Option<PathBuf>, host: PathBuf, sessions: PathBuf) -> Files
user: the user scope’s directory (<config dir>/memory), if
there is a config directory. host: this host’s directory.
sessions: where each session’s directory is made.
Sourcepub fn project_root(cwd: &Path) -> PathBuf
pub fn project_root(cwd: &Path) -> PathBuf
The project a working directory belongs to: see
crate::project_root.
Trait Implementations§
Source§impl Provider for Files
impl Provider for Files
fn remember(&self, cx: &Context, new: New) -> Result<Memory, Error>
Source§fn list(
&self,
cx: &Context,
scope: Option<Scope>,
kind: Option<Kind>,
) -> Result<Found, Error>
fn list( &self, cx: &Context, scope: Option<Scope>, kind: Option<Kind>, ) -> Result<Found, Error>
Newest first.
fn get(&self, cx: &Context, id: &str) -> Result<Memory, Error>
fn update( &self, cx: &Context, id: &str, change: Change, ) -> Result<Memory, Error>
Source§fn put(&self, cx: &Context, m: &Memory) -> Result<Memory, Error>
fn put(&self, cx: &Context, m: &Memory) -> Result<Memory, Error>
Keep
m as it is, under its id and with its times, replacing a
memory with the same id: how memories move between providers
(transfer). m.path and m.score are ignored.Auto Trait Implementations§
impl !Freeze for Files
impl Forget for Files
impl Move for Files
impl RefUnwindSafe for Files
impl Send for Files
impl Sync for Files
impl Unpin for Files
impl UnsafeUnpin for Fileswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
impl UnwindSafe for Files
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more