Commit Graph

50 Commits

Author SHA1 Message Date
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
Matthias Beyer 33b6a89a02 Merge pull request #156 from matthiasbeyer/libimagstore/fix-private-intostoreid
Fix: Make IntoStoreId public
2016-01-29 19:11:03 +01:00
Matthias Beyer 69bebfcfc0 Fix: Make IntoStoreId public 2016-01-29 17:03:24 +01:00
Matthias Beyer c64cdad63b Fix: Add missing documentation for mod module_path 2016-01-29 17:03:05 +01:00
Matthias Beyer bbd08d9526 Add Store::retrieve_for_module() 2016-01-24 17:40:06 +01:00
Matthias Beyer 36770abac5 Add iterator type for StoreId 2016-01-24 17:39:41 +01:00
Marcel Müller 40572d946d iQIcBAABCgAGBQJWomU5AAoJEN1O030MrHbiHZgQAKF7BnDgNMMMLS0B5EkN+rtJ
KDMJjn8iaHcww1H2GMAPxW24xTNdD4JbWOBBC/g76YUtO9XdpXgeiz7JvtfAtZuQ
 mltpTAUncCRFRuTHqvDnKKPWXv4s0NpTJthJOtse+FwhWF8hgCKkXef8lJeMDxLg
 7ipF/bIFnUAYq1BUc2NVguAVD23c+l05lgTEaUlzqNENozJWGqA8EwpE2ShEpjSH
 RmOD9FowY1pFqfIOOTdNcVSNAnIM2LnCEqS9BgeE1vtToeOo9yz9B+ffyqoJgjEp
 AD8Q0S4Kp0pMkduUpZbCEu3KCcSUcdRpojdsAbMKPiiMW/CDQQk3RUavO41zSci3
 gUOqnURaEbLBG4j3h47sA3PZOcsDrBLYL9G4aWk/6BG8kctrC4b3yzDU50InWOJQ
 2b1ppTCcQYnTUOLMvYkm1sFk/LhofH+Wk3GypGlIvw9xJISNHj73G9Qo3tF6OhWL
 /FaMlPPJYTbWsCaQcJTNKO7QcLyV72bJUDBaN9Z8+2ueQvqEwNvBOEcbJnce51+b
 1sOoklhEjpLpGUGvQn0l8Ig2ezV98CJrOwHPqQSTrFBcrCRB2sHLMmt0AzLjINEH
 SCRUj3ZUqp9TMU3X/zH1f1d8lglJhmZcPBomclbliyeXHiSvrBKGytfzeKG+aNIK
 6Ionaq9akACh5kbjctGZ
 =Y00k
 -----END PGP SIGNATURE-----

Add lints to make sure macro does not generate warnings
2016-01-22 18:22:01 +01:00
Marcel Müller 560e7106f8 iQIcBAABCgAGBQJWomPqAAoJEN1O030MrHbiYEEQALGQfJYEfbCgvVejgiwOKMjv
m7U7nEQbMMVYHVbeCdUs2PXHwCFr8slSccyWoF0QNHX4/Tx5t+XJ9JnRsyIhQyzi
 UWRQo3mHDErn2lP+M+4kfDWPpOdJicJKAxyiLgGo/Aw5CblX9MAaKfE85rZh7atx
 JM567tN+O/Cflt676Mva3xnzpisHFKVJKG58k+QzmZOgNtROWg3PTyAb+/T2c6Vd
 Ty+zW4zt7LwKjGlK9YEDqEwpg3STKUPT9T5S6ZFkPHBbjPVtM5yXK1oTWOpE7zn+
 iXSjCqfC2Ok+MT9YB1loexY2f6bzwqZkmWHl3M+4f1fJfhBQR0Zdz4a/hyp2YLcv
 hVW/X/AeVCdoMOBZ9PCaFjY6aXFycB6HlDDU1jldCN5U08BfY+h6hDtW5xaPLj2s
 WWeyIZgnqLJsGk7VK+/KAdDZMAZVwoC69AVXQS+IjejetQWHY5OFhCBfRVZ02/aX
 jwdZSfw5oNCGsvrzknkcECL9bPQAGRptoLbGuuLNPaACNd8ebWTmw4gwxFYwwAGY
 Dq6NDA33S3uRDvK24MpUA8g5OxsU8kzblhP6iYqGTg0dLnGFRzioKDg3v7NFKN9/
 Yy7g1uQCZIVbrVnZF6w68jfuX6IoIHWl6eg6De2AmMNClYGZflDzbSoYCZkiz1d4
 AR6HHXLT84nAJ2tCgK0S
 =6TMR
 -----END PGP SIGNATURE-----

Add macro to create ModuleEntryPath
2016-01-22 18:16:26 +01:00