-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1359 from hannobraun/get
Add infrastructure for abstracting over access to referenced objects
- Loading branch information
Showing
5 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! Infrastructure for abstracting over accessing referenced objects | ||
use crate::storage::Handle; | ||
|
||
/// Access a single referenced object | ||
/// | ||
/// Object types implement this trait for the objects they reference. It can be | ||
/// used by other generic infrastructure to abstract over object access. | ||
/// | ||
/// This trait is specifically intended to access single objects, like *the* | ||
/// curve that a vertex references, not *a* half-edge that a cycle references. | ||
pub trait Get<T> { | ||
/// Access the referenced object | ||
fn get(&self) -> Handle<T>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters