Skip to content

Commit

Permalink
Merge pull request #35 from traP-jp/fix/#34-use-create-instead-of-get
Browse files Browse the repository at this point in the history
Issue #34: Use `create` instead of `get`
  • Loading branch information
hayatroid authored Sep 30, 2024
2 parents a130c9e + 365acad commit 29efa4a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions judge-control-app/src/custom_file/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ use uuid::Uuid;
pub trait File: Sized + Drop {
type InitArgs;
fn new(path: PathBuf, args: Self::InitArgs) -> Result<Self>;
fn get_hardlink_to(&self, path: PathBuf) -> Result<Self>;
fn create_hardlink_to(&self, path: PathBuf) -> Result<Self>;
}

pub trait FileFactory: Sized {
fn new(path: PathBuf) -> Result<Self>;
fn get_file<FileType: File>(&self, uuid: Uuid, args: FileType::InitArgs) -> Result<FileType>;
fn get_hardlink_of<FileType: File>(&self, uuid: Uuid, original: FileType) -> Result<FileType>;
fn create_file<FileType: File>(&self, uuid: Uuid, args: FileType::InitArgs)
-> Result<FileType>;
fn create_hardlink_of<FileType: File>(
&self,
uuid: Uuid,
original: FileType,
) -> Result<FileType>;
}

0 comments on commit 29efa4a

Please sign in to comment.