diff options
author | Stewart Stewart <stewinsalot@gmail.com> | 2016-12-18 16:33:03 -0500 |
---|---|---|
committer | Stewart Stewart <stewinsalot@gmail.com> | 2016-12-18 16:35:01 -0500 |
commit | f1c50e2cbe757926df7a94284eb0246c66394779 (patch) | |
tree | 856c99cf7552550fa52c05c6898ec2e4b5841995 /src/main | |
parent | f0b89933f97c73c14484643c14438d23e1723334 (diff) | |
download | driver-core-f1c50e2cbe757926df7a94284eb0246c66394779.tar.gz driver-core-f1c50e2cbe757926df7a94284eb0246c66394779.tar.bz2 driver-core-f1c50e2cbe757926df7a94284eb0246c66394779.zip |
add documentation for sameId
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/scala/xyz/driver/core/core.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/core/core.scala b/src/main/scala/xyz/driver/core/core.scala index ce6be34..1a6bdd7 100644 --- a/src/main/scala/xyz/driver/core/core.scala +++ b/src/main/scala/xyz/driver/core/core.scala @@ -25,6 +25,13 @@ package object core { package core { + /** + * Evidence that Id[A] can be safely converted to Id[B]. + * e.g. `implicit val CaseId = Id.sameId[Case, CasesRow]` + * if `CaseId` is in scope, we can use either of: + * `casesRowId.asId[Case]` or `caseId.asId[CasesRow]` + * Override convert for custom Id conversions. + */ @implicitNotFound("No evidence that ${A} has the same Id as ${B}") sealed trait SameId[A, B] { def convert(id: Id[A]): Id[B] = Id[B](id.value) |