Skip to content

Commit d7bfe23

Browse files
committed
add more docs and licence files
1 parent c4f68ef commit d7bfe23

File tree

3 files changed

+48
-5
lines changed

3 files changed

+48
-5
lines changed

LICENCE-APACHE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2016 Erin Power
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

LICENCE-MIT

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License (MIT)
2+
3+
Copyright (c) 2016 Erin Power
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

src/types.rs

+14-5
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,23 @@ pub trait AsnType {
4747
const TAG: Tag;
4848
}
4949

50+
/// A newtype wrapper that will explicitly tag its value with `T`'s tag.
51+
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
52+
pub struct Explicit<T, V>{
53+
_tag: core::marker::PhantomData<T>,
54+
pub(crate) value: V,
55+
}
56+
57+
/// A newtype wrapper that will implicitly tag its value with `T`'s tag.
58+
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
59+
pub struct Implicit<T, V>{
60+
_tag: core::marker::PhantomData<T>,
61+
pub(crate) value: V,
62+
}
63+
5064
macro_rules! tag_kind {
5165
($($name:ident),+) => {
5266
$(
53-
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
54-
pub struct $name<T, V>{
55-
_tag: core::marker::PhantomData<T>,
56-
pub(crate) value: V,
57-
}
5867

5968
impl<T, V> $name<T, V>{
6069
pub fn new(value: V) -> Self {

0 commit comments

Comments
 (0)