Commit Graph

57 Commits

Author SHA1 Message Date
Matthias Beyer 5462714fcc Remove libimagstore::storeid::build_entry_path() 2016-08-28 18:41:56 +02:00
Matthias Beyer d252623b75 Add StoreId::components() to get components of StoreId "id" part 2016-08-28 18:41:55 +02:00
Matthias Beyer d538a5b380 Fixup StoreId test 2016-08-28 18:41:55 +02:00
Matthias Beyer 4c435d9347 Add StoreId::with_base() 2016-08-28 18:41:54 +02:00
Matthias Beyer 784f1cc4c6 Fix interface of IntoStoreId trait to return Result<StoreId> and impls 2016-08-28 18:41:54 +02:00
Matthias Beyer d5723791a6 Add StoreId::without_base() 2016-08-28 18:41:54 +02:00
Matthias Beyer ab23d04e04 Add StoreId::new_baseless() 2016-08-28 18:41:54 +02:00
Matthias Beyer d1f07cd087 Add check in StoreId::new() whether the local part is absolute 2016-08-28 18:41:54 +02:00
Matthias Beyer 111cb4f29a Add StoreId::to_str() -> String 2016-08-28 18:41:54 +02:00
Matthias Beyer 3f88c27834 Remove unused imports 2016-08-28 18:41:53 +02:00
Matthias Beyer 1de09f1606 Rewrite StoreId::storified() 2016-08-28 18:41:53 +02:00
Matthias Beyer 1af3ab018b Use StoreId::new() in macro 2016-08-28 18:41:53 +02:00
Matthias Beyer fe73a53d44 Add StoreId::new() 2016-08-28 18:41:53 +02:00
Matthias Beyer 8dff5685fd Make StoreId.base optional 2016-08-28 18:41:53 +02:00
Matthias Beyer ad92b05fb4 Remove IntoStoreId for PathBuf 2016-08-28 18:41:53 +02:00
Matthias Beyer adf213bbc7 Remove From<PathBuf> for StoreId 2016-08-28 18:41:53 +02:00
Matthias Beyer cf84df3ce7 Remove From<String> for StoreId 2016-08-28 18:41:53 +02:00
Matthias Beyer bcd917055d Remove AsRef<Path> for StoreId 2016-08-28 18:41:53 +02:00
Matthias Beyer 30a76d57f6 Remove Borrow<Path> for StoreId 2016-08-28 18:41:53 +02:00
Matthias Beyer 8c5a427a01 Rewrite Borrow<Path> for StoreId 2016-08-28 18:41:52 +02:00
Matthias Beyer 55953cfe5b Rewrite AsRef<Path> for StoreId 2016-08-28 18:41:52 +02:00
Matthias Beyer 1d165f6fc2 Remove Deref for StoreId but provide basic functions within the type 2016-08-28 18:41:52 +02:00
Matthias Beyer 69b3f6bf87 Rewrite Display for StoreId 2016-08-28 18:41:52 +02:00
Matthias Beyer fb1df533c5 Rewrite Into<PathBuf> for StoreId 2016-08-28 18:41:52 +02:00
Matthias Beyer 6841b7c340 Rewrite StoreId::storified() 2016-08-28 18:41:52 +02:00
Matthias Beyer 264d651f1d Make StoreId be two parts: base and id 2016-08-28 18:41:52 +02:00
Matthias Beyer 580ea28877 Fix Display impl for StoreId by using lossy string rep if PathBuf::to_str() fails 2016-07-05 13:47:58 +02:00
Matthias Beyer d7f22020e6 Merge pull request #489 from matthiasbeyer/libimagstore/storify-id
Libimagstore/storify
2016-07-04 19:26:42 +02:00
Matthias Beyer 9605d6daa6 Ensure that StoreId::storified() does not alter already storified StoreId objects 2016-07-04 12:49:12 +02:00
Matthias Beyer 31d5dac63d Revert "Add StoreId::unstorified()"
This reverts commit 37380c84b9.

We do not want such a feature in the store, actually.
StoreId objects are either storified or not, but you cannot unstorify
them.
2016-07-04 12:45:17 +02:00
Matthias Beyer 37380c84b9 Add StoreId::unstorified() 2016-07-04 12:44:58 +02:00
Matthias Beyer 12b8f8f331 Move storification of StoreId object to new StoreId::storified() func 2016-07-02 17:52:12 +02:00
Matthias Beyer ea4487a481 Impl Display for StoreId 2016-06-30 11:02:58 +02:00
Matthias Beyer e91eb2f55d Use error.into() instead of building full type 2016-05-26 22:19:29 +02:00
Matthias Beyer 5e98bd76b1 Shorten type names in import 2016-05-26 22:19:08 +02:00
Andre Bogus 981707c9c9 more style adaptations
again following clippy
2016-05-13 22:27:53 +02:00
Matthias Beyer b9d8e5728b Move GlobStoreIdIterator implementation so we can have it non-public 2016-05-12 17:27:41 +02:00
Matthias Beyer a510e1b6b6 Add error printing (debug) in GlobStoreIdIterator helper type 2016-05-12 17:24:27 +02:00
Matthias Beyer 5972ce7f37 Make StoreIdIterator generic
This patch makes the StoreIdIterator type generic over all iterators
with Item = StoreId.

As the StoreIdIterator type was previousely used for iterating over a
glob() result, I had to wrap this result type in another iterator type
which is then wrapped in StoreIdIterator.

With this patch applied, other libraries may use the StoreIdIterator
type to abstract things away in their implementation.
2016-05-12 17:21:04 +02:00
Matthias Beyer 24ddf5d53b Impl IntoStoreId for StoreId 2016-05-04 13:30:19 +02:00
Matthias Beyer 7e17e213be Fixup ModuleEntryPath macro type 2016-05-04 13:30:19 +02:00
Matthias Beyer b4db587a10 Impl Deref<PathBuf> for StoreId 2016-05-03 14:58:18 +02:00
Matthias Beyer 4d4acf9168 Fix IntoStoreId implementation 2016-05-03 14:58:05 +02:00
Matthias Beyer 799b9e27a5 Remove typedef for StoreId type
but make it a new type instead.

Also derive and implement as many traits as possible for it, so we keep
backwards compatibility as much as possible.

Anyways, we need to rewrite some code for this.

Suggested-by: Marcel Müller <neikos@neikos.email>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2016-05-03 14:58:05 +02:00
Matthias Beyer fd9dee7dea Implement Debug for StoreIdIterator 2016-04-20 21:46:02 +02:00
Matthias Beyer a4c820d308 Remove unused keyword "mut" 2016-03-22 19:43:48 +01:00
Matthias Beyer 80945fcd16 Rewrite build_entry_path() so it does not panic!() anymore 2016-03-19 14:48:09 +01:00
Matthias Beyer b8b49b3240 Move: build_entry_path() from imag-store to libimagstore 2016-03-19 14:47:45 +01:00
Matthias Beyer 6d7065d10e Fix test: StoreId does not start with "/" anymore 2016-03-10 19:12:00 +01:00
Matthias Beyer a3a09ff4ee Fix store creation of libimagstore
The macro may not prefix the StoreId internal PathBuf with '/', so this
path is not absolute. This way we can introduce `storify_id()` which
creates a proper PathBuf into the store out of our StoreId object.

Does not yet do verification whether the path is inside the store,
actually.
2016-03-10 18:46:26 +01:00